summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-09-16 14:27:20 +0000
committerNorbert Preining <preining@logic.at>2010-09-16 14:27:20 +0000
commite4caa4588d8cf4fa5f51a525214fc5d28775a5d9 (patch)
tree2d03e643934c408671c3744631aca8527f6d6741 /Master/tlpkg/TeXLive
parent65c2d2060aeaee430765b0ec72e6867f16f9d6b8 (diff)
fix stupid error in parsing executes and all other lines in the tlpdb file:
originally the code for parsing was if ($line =~ m/^keyword\s+(.*)\s*) { (cum grano salis). But well, the terminal \s* will never be found since the .* before is greedy. Solution would be to change either all the .* to .*?, or, as done here, remove terminal whitespace and grep for (.*)$. This gives also a slight semantics change, but that was anyway never allowed, namely that you could write lines revision 1234 12121 jkfj j sooooo and still it was correctly parsed (maybe --- didn't test it). git-svn-id: svn://tug.org/texlive/trunk@19756 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm44
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm25
2 files changed, 42 insertions, 27 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index b13e1655594..5e3804d87a6 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -113,6 +113,8 @@ sub from_fh {
die("Continuation of $lastcmd not allowed, please fix tlpobj: line = $line!\n");
}
}
+ # remove white space at the end of a line
+ $line =~ s/\s*$//;
if ($line =~ /^name\s*([-.\w]+)/o) {
$name = "$1";
$lastcmd = "name";
@@ -144,7 +146,7 @@ sub from_fh {
}
}
next;
- } elsif ($line =~ /^binfilescontinued\s+(.*)\s*/o) {
+ } elsif ($line =~ /^binfilescontinued\s+(.*)$/o) {
push @{$self->{'binfiles'}{$arch}}, "$1";
next;
} elsif ($line =~ /^binfiles\s+/o) {
@@ -166,7 +168,15 @@ sub from_fh {
}
$lastcmd = "binfiles";
next;
- } elsif ($line =~ /^longdesc\s+(.*)\s*/o) {
+ } elsif ($line eq "longdesc") {
+ if (defined($self->{'longdesc'})) {
+ $self->{'longdesc'} .= " ";
+ } else {
+ $self->{'longdesc'} = "";
+ }
+ $lastcmd = "longdesc";
+ next;
+ } elsif ($line =~ /^longdesc\s+(.*)$/o) {
if (defined($self->{'longdesc'})) {
$self->{'longdesc'} .= " $1";
} else {
@@ -174,7 +184,7 @@ sub from_fh {
}
$lastcmd = "longdesc";
next;
- } elsif ($line =~ /^category\s+(.*)\s*/o) {
+ } elsif ($line =~ /^category\s+(.*)$/o) {
$self->{'category'} = "$1";
$lastcmd = "category";
if ($self->{'category'} !~ /^$CategoriesRegexp/o) {
@@ -182,39 +192,39 @@ sub from_fh {
. $self->name . " found.\nPlease update texlive.infra.\n");
}
next;
- } elsif ($line =~ /^relocated\s+([01])\s*/o) {
+ } elsif ($line =~ /^relocated\s+([01])$/o) {
$self->relocated("$1");
$lastcmd = "relocated";
next;
- } elsif ($line =~ /^revision\s+(.*)\s*/o) {
+ } elsif ($line =~ /^revision\s+(.*)$/o) {
$self->{'revision'} = "$1";
$lastcmd = "revision";
next;
- } elsif ($line =~ /^containersize\s+([0-9]+)\s*/o) {
+ } elsif ($line =~ /^containersize\s+([0-9]+)$/o) {
$self->containersize("$1");
$lastcmd = "containersize";
next;
- } elsif ($line =~ /^srccontainersize\s+([0-9]+)\s*/o) {
+ } elsif ($line =~ /^srccontainersize\s+([0-9]+)$/o) {
$self->srccontainersize("$1");
$lastcmd = "srccontainersize";
next;
- } elsif ($line =~ /^doccontainersize\s+([0-9]+)\s*/o) {
+ } elsif ($line =~ /^doccontainersize\s+([0-9]+)$/o) {
$self->doccontainersize("$1");
$lastcmd = "doccontainersize";
next;
- } elsif ($line =~ /^containermd5\s+([a-f0-9]+)\s*/o) {
+ } elsif ($line =~ /^containermd5\s+([a-f0-9]+)$/o) {
$self->containermd5("$1");
$lastcmd = "containermd5";
next;
- } elsif ($line =~ /^srccontainermd5\s+([a-f0-9]+)\s*/o) {
+ } elsif ($line =~ /^srccontainermd5\s+([a-f0-9]+)$/o) {
$self->srccontainermd5("$1");
$lastcmd = "srccontainermd5";
next;
- } elsif ($line =~ /^doccontainermd5\s+([a-f0-9]+)\s*/o) {
+ } elsif ($line =~ /^doccontainermd5\s+([a-f0-9]+)$/o) {
$self->doccontainermd5("$1");
$lastcmd = "doccontainermd5";
next;
- } elsif ($line =~ /^catalogue\s+(.*)\s*/o) {
+ } elsif ($line =~ /^catalogue\s+(.*)$/o) {
$self->catalogue("$1");
$lastcmd = "catalogue";
next;
@@ -235,23 +245,23 @@ sub from_fh {
$self->{"${type}size"} = $size;
}
next;
- } elsif ($line =~ /^execute(continued)?\s*(.*)\s*/o) {
+ } elsif ($line =~ /^execute(continued)?\s*(.*)$/o) {
push @{$self->{'executes'}}, "$2" unless "$2" eq "";
$lastcmd = "execute";
next;
- } elsif ($line =~ /^postaction(continued)?\s*(.*)\s*/o) {
+ } elsif ($line =~ /^postaction(continued)?\s*(.*)$/o) {
push @{$self->{'postactions'}}, "$2" unless "$2" eq "";
$lastcmd = "postaction";
next;
- } elsif ($line =~ /^depend(continued)?\s*(.*)\s*/o) {
+ } elsif ($line =~ /^depend(continued)?\s*(.*)$/o) {
push @{$self->{'depends'}}, "$2" unless "$2" eq "";
$lastcmd = "depend";
next;
- } elsif ($line =~ /^catalogue-([^\s]+)\s+(.*)\s*/o) {
+ } elsif ($line =~ /^catalogue-([^\s]+)\s+(.*)$/o) {
$self->{'cataloguedata'}{$1} = "$2";
} elsif ($line =~ /^catalogue-([^\s]+)\s*/o) {
1; # ignore e.g. catalogue-ctan without parameter
- } elsif ($line =~ /^shortdesc\s+(.*)\s*/o) {
+ } elsif ($line =~ /^shortdesc\s+(.*)$/o) {
$self->{'shortdesc'} .= "$1";
$lastcmd = "shortdesc";
next;
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index a030f7bd53f..ac07d969b87 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -108,6 +108,8 @@ sub from_file
if ($line =~ /^ /) {
die "$srcfile: non-continuation indentation not allowed: `$line'";
}
+ # remove terminal white space
+ $line =~ s/\s*$//;
# names of source packages can either be
# - normal names: ^[-\w]+$
# - win32 specific packages: ^[-\w]+\.win32$
@@ -120,37 +122,40 @@ sub from_file
} else {
# we default to the file name as package name
# $started || die "$srcfile: first directive must be `name', not $line";
- if ($line =~ /^shortdesc\s*(.*)\s*$/) {
+ if ($line =~ /^shortdesc\s*(.*)$/) {
$shortdesc = $1;
next;
} elsif ($line =~ /^category\s+$CategoriesRegexp$/) {
$category = $1;
next;
- } elsif ($line =~ /^longdesc\s+(.*)\s*$/) {
+ } elsif ($line =~ /^longdesc$/) {
+ $longdesc .= "\n";
+ next;
+ } elsif ($line =~ /^longdesc\s+(.*)$/) {
$longdesc .= "$1 ";
next;
- } elsif ($line =~ /^catalogue\s+(.*)\s*$/) {
+ } elsif ($line =~ /^catalogue\s+(.*)$/) {
$catalogue = $1;
next;
- } elsif ($line =~ /^runpattern\s+(.*)\s*$/) {
+ } elsif ($line =~ /^runpattern\s+(.*)$/) {
push @runpatterns, $1 if ($1 ne "");
next;
- } elsif ($line =~ /^srcpattern\s+(.*)\s*$/) {
+ } elsif ($line =~ /^srcpattern\s+(.*)$/) {
push @srcpatterns, $1 if ($1 ne "");
next;
- } elsif ($line =~ /^docpattern\s+(.*)\s*$/) {
+ } elsif ($line =~ /^docpattern\s+(.*)$/) {
push @docpatterns, $1 if ($1 ne "");
next;
- } elsif ($line =~ /^binpattern\s+(.*)\s*$/) {
+ } elsif ($line =~ /^binpattern\s+(.*)$/) {
push @binpatterns, $1 if ($1 ne "");
next;
- } elsif ($line =~ /^execute\s+(.*)\s*$/) {
+ } elsif ($line =~ /^execute\s+(.*)$/) {
push @executes, $1 if ($1 ne "");
next;
- } elsif ($line =~ /^depend\s+(.*)\s*$/) {
+ } elsif ($line =~ /^depend\s+(.*)$/) {
push @depends, $1 if ($1 ne "");
next;
- } elsif ($line =~ /^postaction\s+(.*)\s*$/) {
+ } elsif ($line =~ /^postaction\s+(.*)$/) {
push @postactions, $1 if ($1 ne "");
next;
} else {