diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPOBJ.pm | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index a9835dff314..e7d89909630 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -118,14 +118,23 @@ sub from_fh { # docfiles can have tags, but the parse_line function is so # time intense that we try to call it only when necessary if (defined $rest) { - my @words = &TeXLive::TLUtils::parse_line('\s+', 0, $rest); - for (@words) { - my ($k, $v) = split('=', $_, 2); - if ($k eq 'details' || $k eq 'language') { - $self->{'docfiledata'}{$f}{$k} = $v; - } else { - die "Unknown docfile tag: $line"; - } + # parse_line has problems with double quotes in double quotes + # my @words = &TeXLive::TLUtils::parse_line('\s+', 0, $rest); + # do manual parsing + # this is not optimal, but since we support only two tags there + # are not so many cases + if ($rest =~ m/^details="(.*)"\s*$/) { + $self->{'docfiledata'}{$f}{'details'} = $1; + } elsif ($rest =~ m/^language="(.*)"\s*$/) { + $self->{'docfiledata'}{$f}{'language'} = $1; + } elsif ($rest =~ m/^language="(.*)"\s+details="(.*)"\s*$/) { + $self->{'docfiledata'}{$f}{'details'} = $2; + $self->{'docfiledata'}{$f}{'language'} = $1; + } elsif ($rest =~ m/^details="(.*)"\s+language="(.*)"\s*$/) { + $self->{'docfiledata'}{$f}{'details'} = $1; + $self->{'docfiledata'}{$f}{'language'} = $2; + } else { + die "Unparsable tagging in line: =$line="; } } } elsif ($lastcmd eq "binfiles") { @@ -311,12 +320,12 @@ sub writeout { print $fd " $f"; if (defined($self->{'docfiledata'}{$f}{'details'})) { my $tmp = $self->{'docfiledata'}{$f}{'details'}; - $tmp =~ s/\"/\\\"/g; + #$tmp =~ s/\"/\\\"/g; print $fd ' details="', $tmp, '"'; } if (defined($self->{'docfiledata'}{$f}{'language'})) { my $tmp = $self->{'docfiledata'}{$f}{'language'}; - $tmp =~ s/\"/\\\"/g; + #$tmp =~ s/\"/\\\"/g; print $fd ' language="', $tmp, '"'; } print $fd "\n"; |