texlive[48145] Master/tlpkg: TLPSRC.pm (from_file): do ${PKGNAME}

commits+karl at tug.org commits+karl at tug.org
Thu Jul 5 23:20:15 CEST 2018


Revision: 48145
          http://tug.org/svn/texlive?view=revision&revision=48145
Author:   karl
Date:     2018-07-05 23:20:15 +0200 (Thu, 05 Jul 2018)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/Master/tlpkg/TeXLive/TLPSRC.pm
    trunk/Master/tlpkg/TeXLive/TLTREE.pm
    trunk/Master/tlpkg/tlpsrc/fontawesome.tlpsrc
    trunk/Master/tlpkg/tlpsrc/lm.tlpsrc

Modified: trunk/Master/tlpkg/TeXLive/TLPSRC.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2018-07-05 18:05:05 UTC (rev 48144)
+++ trunk/Master/tlpkg/TeXLive/TLPSRC.pm	2018-07-05 21:20:15 UTC (rev 48145)
@@ -65,7 +65,6 @@
   close(TMP);
 
   my $name = $pkgname;
-  # default category = Package
   my $category = "Package";
   my $shortdesc = "";
   my $longdesc= "";
@@ -77,6 +76,7 @@
   my $finished = 0;
   my $savedline = "";
   my %tlpvars;
+  $tlpvars{"PKGNAME"} = $name;
 
   my $lineno = 0;
   for my $line (@lines) {
@@ -107,18 +107,20 @@
     # 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 @@
                . "(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;

Modified: trunk/Master/tlpkg/TeXLive/TLTREE.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLTREE.pm	2018-07-05 18:05:05 UTC (rev 48144)
+++ trunk/Master/tlpkg/TeXLive/TLTREE.pm	2018-07-05 21:20:15 UTC (rev 48145)
@@ -319,7 +319,6 @@
 sub get_matching_files {
   my ($self, $type, $p, $pkg, $arch) = @_;
   my $ARCH = $arch;
-  my $PKGNAME = $pkg;
   my $newp;
   {
     my $warnstr = "";

Modified: trunk/Master/tlpkg/tlpsrc/fontawesome.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/fontawesome.tlpsrc	2018-07-05 18:05:05 UTC (rev 48144)
+++ trunk/Master/tlpkg/tlpsrc/fontawesome.tlpsrc	2018-07-05 21:20:15 UTC (rev 48145)
@@ -1 +1 @@
-execute addMap fontawesome.map
+execute addMap ${PKGNAME}.map

Modified: trunk/Master/tlpkg/tlpsrc/lm.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/lm.tlpsrc	2018-07-05 18:05:05 UTC (rev 48144)
+++ trunk/Master/tlpkg/tlpsrc/lm.tlpsrc	2018-07-05 21:20:15 UTC (rev 48145)
@@ -1 +1 @@
-execute addMap lm.map
+execute addMap ${PKGNAME}.map



More information about the tex-live-commits mailing list