summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/tlpkg/TeXLive/TLPSRC.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm
index a2faf894386..a2a7e036a7e 100644
--- a/Master/tlpkg/TeXLive/TLPSRC.pm
+++ b/Master/tlpkg/TeXLive/TLPSRC.pm
@@ -83,6 +83,7 @@ sub from_file {
my $foundnametag = 0;
my $finished = 0;
my $savedline = "";
+ my %tlpvars;
my $lineno = 0;
for my $line (@lines) {
@@ -119,6 +120,12 @@ sub from_file {
$foundnametag && die "$srcfile: second name directive not allowed: $name";
$foundnametag = 1;
} else {
+ # expand tlpvars while reading in
+ # that means we have to respect *order* and define variables
+ # first in the tlpsrc file
+ for my $k (keys %tlpvars) {
+ $line =~ s/\$\{\Q$k\E\}/$tlpvars{$k}/g;
+ }
# we default to the file name as package name
# $started || die "$srcfile: first directive must be `name', not $line";
if ($line =~ /^shortdesc\s*(.*)$/) {
@@ -160,6 +167,9 @@ sub from_file {
} elsif ($line =~ /^postaction\s+(.*)$/) {
push @postactions, $1 if ($1 ne "");
next;
+ } elsif ($line =~ /^tlpsetvar\s+([-a-zA-Z_0-9]*)\s+(.*)$/) {
+ $tlpvars{$1} = $2;
+ next;
} else {
tlwarn("$srcfile:$lineno: unknown tlpsrc directive, fix fix: $line\n");
}