diff options
| author | fukachan <fukachan> | 2004-03-17 14:20:47 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-03-17 14:20:47 +0000 |
| commit | ec580b32d2d440e1b909a6bcbc6b09d525259707 (patch) | |
| tree | 6411fd952b5466fb10be78ee94f0599fb3602d5d /fml/lib | |
| parent | 7cf59a216c430063178c2ffbd6b9f146eea0319e (diff) | |
| download | fml8-ec580b32d2d440e1b909a6bcbc6b09d525259707.tar.gz fml8-ec580b32d2d440e1b909a6bcbc6b09d525259707.tar.bz2 fml8-ec580b32d2d440e1b909a6bcbc6b09d525259707.zip | |
tune key output order.
postpone some variables e.g. *_HOOK.
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Merge.pm | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/fml/lib/FML/Merge.pm b/fml/lib/FML/Merge.pm index eb4da5b9..98635e3e 100644 --- a/fml/lib/FML/Merge.pm +++ b/fml/lib/FML/Merge.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Merge.pm,v 1.5 2004/03/17 08:38:31 fukachan Exp $ +# $FML: Merge.pm,v 1.6 2004/03/17 12:55:03 fukachan Exp $ # package FML::Merge; @@ -284,7 +284,7 @@ sub _inject_into_config_cf sub _inject_diff_into_config_cf { my ($self, $wh, $diff) = @_; - my ($k, $v, $x); + my ($k, $v, $x, $y); print $wh "\n"; print $wh "# BEGIN OF CONFIG CONVERSION\n"; @@ -293,10 +293,14 @@ sub _inject_diff_into_config_cf use FML::Merge::FML4::config_ph; my $config_ph = new FML::Merge::FML4::config_ph; - while (($k, $v) = each %$diff) { - print $wh "# $k => $v\n"; + for my $k (sort _sort_order keys %$diff) { + $v = $diff->{ $k }; + $y = $v; + $y =~ s/\n/\n# /gm; + print $wh "# $k => $y\n"; + if ($x = $config_ph->translate($k, $v)) { - print $wh $x ,"\n\n"; + print $wh $x ,"\n"; } } @@ -306,6 +310,20 @@ sub _inject_diff_into_config_cf } +sub _sort_order +{ + my $x = $a; + my $y = $b; + + $x = "zz_$x" if $x =~ /^PROC__/o; + $y = "zz_$y" if $y =~ /^PROC__/o; + $x = "zzz_$x" if $x =~ /HOOK/o; + $y = "zzz_$y" if $y =~ /HOOK/o; + + $x cmp $y; +} + + =head1 UTILITIES =cut |
