diff options
Diffstat (limited to 'Master/tlpkg')
-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 |