summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPSRC.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-07-05 21:20:15 +0000
committerKarl Berry <karl@freefriends.org>2018-07-05 21:20:15 +0000
commitf8fda7824b2b8cdebc2f57a8dc1aefdec29b14e9 (patch)
treef2c948737d0a094201887bf0a9f6ebeacefaedd8 /Master/tlpkg/TeXLive/TLPSRC.pm
parentc0df6a1395f65645200563c3586fb2c4b73e0630 (diff)
TLPSRC.pm (from_file): do ${PKGNAME} expansion here, like user vars.
TLTREE.pm (get_matching_files): remove PKGNAME var handling. *.tlpsrc: use ${PKGNAME} for a couple of .map files; dozens more could be done. git-svn-id: svn://tug.org/texlive/trunk@48145 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPSRC.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index bab1da115a6..218a7baf279 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -65,7 +65,6 @@ sub from_file {
close(TMP);
my $name = $pkgname;
- # default category = Package
my $category = "Package";
my $shortdesc = "";
my $longdesc= "";
@@ -77,6 +76,7 @@ sub from_file {
my $finished = 0;
my $savedline = "";
my %tlpvars;
+ $tlpvars{"PKGNAME"} = $name;
my $lineno = 0;
for my $line (@lines) {
@@ -107,18 +107,20 @@ sub from_file {
# that means we have to respect *order* and define variables
# as we read the tlpsrc file.
if ($line !~ /^(short|long)desc\s/) {
+ #debug: my $origline = $line;
for my $k (keys %tlpvars) {
$line =~ s/\$\{\Q$k\E\}/$tlpvars{$k}/g;
}
# check that no variables remain unexpanded, or rather, for any
# remaining $ (which we don't otherwise allow in tlpsrc files, so
- # should never occur) ... except for ${ARCH} and ${PKGNAME} which
- # we specially expand. (Sigh: we distribute one file dvi$pdf.bat, but
- # fortunately we match it with a directory.)
+ # should never occur) ... except for ${ARCH} which we specially
+ # expand in TLTREE.pm. (Sigh: we distribute one file dvi$pdf.bat,
+ # but fortunately it is matched by a directory.)
#
- (my $testline = $line) =~ s,\$\{(ARCH|PKGNAME)\},,g;
+ (my $testline = $line) =~ s,\$\{ARCH\},,g;
$testline =~ /\$/
&& die "$srcfile:$lineno: variable undefined or syntax error: $line\n";
+ #debug: warn "new line $line, from $origline\n" if $origline ne $line;
} # end variable expansion.
# names of source packages can either be
@@ -133,6 +135,10 @@ sub from_file {
. "(have $name)\n";
$name = $1;
$foundnametag = 1;
+ # let's assume that $PKGNAME doesn't occur before any name
+ # directive (which would result in different expansions); there is
+ # no need for it in practice.
+ $tlpvars{"PKGNAME"} = $name;
} elsif ($line =~ /^category\s+$CategoriesRegexp$/) {
$category = $1;