diff options
author | Norbert Preining <preining@logic.at> | 2010-05-27 18:10:02 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-05-27 18:10:02 +0000 |
commit | dc6ffea804e0564662db7287e30217795372252b (patch) | |
tree | cdc03f4cbe9342b5c7b252a501b30ad03623a194 | |
parent | fb2d0d6b18546db25c5ef6ea841bc6a216d98dba (diff) |
more fixes to TLConfFile.pm
git-svn-id: svn://tug.org/texlive/trunk@18532 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/TeXLive/TLConfFile.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLConfFile.pm b/Master/tlpkg/TeXLive/TLConfFile.pm index ce69f465709..13e6904595e 100644 --- a/Master/tlpkg/TeXLive/TLConfFile.pm +++ b/Master/tlpkg/TeXLive/TLConfFile.pm @@ -175,9 +175,13 @@ sub save # we have to check whether the original data has been changed!! if ($self{'keyvalue'}{$config{$i}{'key'}}{'status'} eq 'changed') { $is_changed = 1; - print $fhout "$config{$i}{'key'} $config{'sep'} $self{'keyvalue'}{$config{$i}{'key'}}{'value'}\n"; + print $fhout "$config{$i}{'key'} $config{'sep'} $self{'keyvalue'}{$config{$i}{'key'}}{'value'}"; + if (defined($config{$i}{'postcomment'})) { + print $fhout $config{$i}{'postcomment'}; + } + print $fhout "\n"; } else { - print $fhout "$config{$i}{'key'} $config{'sep'} $config{$i}{'value'}"; + print $fhout "$config{$i}{'original'}"; print $fhout ($config{$i}{'multiline'} ? "\\\n" : "\n"); } } elsif ($config{$i}{'type'} eq 'continuation') { @@ -238,6 +242,7 @@ sub parse_config_file { my $lines = $#data; my $cont_running = 0; for my $l (0..$lines) { + $config{$l}{'original'} = $data[$l]; if ($cont_running) { if ($data[$l] =~ m/^(.*)\\$/) { $config{$l}{'type'} = 'continuation'; @@ -279,10 +284,13 @@ sub parse_config_file { } # mind that the .*? is making the .* NOT greedy, ie matching as few as # possible. That way we can get rid of the comments at the end of lines - if ($data[$l] =~ m/^\s*([^\s$sep]+)\s*$sep\s*(.*?)\s*($cc.*)?$/) { + if ($data[$l] =~ m/^\s*([^\s$sep]+)\s*$sep\s*(.*?)(\s*$cc.*)?$/) { $config{$l}{'type'} = 'data'; $config{$l}{'key'} = $1; $config{$l}{'value'} = $2; + if (defined($3)) { + $config{$l}{'postcomment'} = $3; + } next; } # if we are still here, that means we cannot evaluate the config file |