summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2013-09-15 02:43:26 +0000
committerNorbert Preining <preining@logic.at>2013-09-15 02:43:26 +0000
commitc58792b048d9b6ccc220792a0a7b13c90b08fc38 (patch)
tree191404eee31c37bc1c04d51982096c22ea880216 /Master
parentb075e08d194788192d57156f1e64dc93d2591065 (diff)
read arbitrary stupid quoting in docfile tags
git-svn-id: svn://tug.org/texlive/trunk@31656 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm29
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";