diff options
author | Karl Berry <karl@freefriends.org> | 2020-01-03 18:32:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-01-03 18:32:13 +0000 |
commit | 9c856b8f43fd52bb6996cb661096c91b3eeed5f3 (patch) | |
tree | 94ac870fa70ff0f28bc531d75bd69607dd27f871 /Master/tlpkg/TeXLive | |
parent | 25d4a223a880a9ba0ad766a9d11bfc7c84fa81c4 (diff) |
* TLPSRC.pm (from_file): also expand global ${wndws} as super-special case.
(make_tlpobj): expand global tlpvars in patterns too.
(find_default_patterns): allow wndws.
* 00texlive.autopatterns.tlpsrc (wndws): define, as a first step towards
also supporting w64.
* 00texlive.installer.tlpsrc: use it.
* 00texlive.autopatterns.tlpsrc (global_no_luajit_platforms): define since
we now support global vars in patterns.
* luajittex.tlpsrc,
* mflua.tlpsrc: use it.
git-svn-id: svn://tug.org/texlive/trunk@53309 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPSRC.pm | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm index a035c862b81..1223e22489c 100644 --- a/Master/tlpkg/TeXLive/TLPSRC.pm +++ b/Master/tlpkg/TeXLive/TLPSRC.pm @@ -143,12 +143,12 @@ sub from_file { # 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} which we specially - # expand in TLTREE.pm, and ${global_*} which need to be defined in - # 00texlive.autopatterns.tlpsrc. (We distribute one file dvi$pdf.bat, - # but fortunately it is matched by a directory.) + # expand in TLTREE.pm, and ${global_*} (and ${wndws}) which need to + # be defined in 00texlive.autopatterns.tlpsrc. (We distribute one + # file dvi$pdf.bat, but fortunately it is matched by a directory.) # (my $testline = $line) =~ s,\$\{ARCH\},,g; - $testline =~ s,\$\{global_[^}]*\},,g; + $testline =~ s,\$\{(global_[^}]*|wndws)\},,g; $testline =~ /\$/ && die "$srcfile:$lineno: variable undefined or syntax error: $line\n"; #debug: warn "new line $line, from $origline\n" if $origline ne $line; @@ -363,6 +363,11 @@ sub make_tlpobj { @autoaddpat = (); $usedefault = 1; foreach my $p (@{$self->{${pattype} . 'patterns'}}) { + # Expansion of ${global_...} variables from autopatterns. + for my $key (keys %global_tlpvars) { + $p =~ s/\$\{\Q$key\E\}/$global_tlpvars{$key}/g; + } + if ($p =~ m/^a\s+(.*)\s*$/) { # format # a toplevel1 toplevel2 toplevel3 ... @@ -559,7 +564,7 @@ sub _do_normal_pattern { # # The returned hash has an additional key C<tlpvars> for global tlpsrc # variables, which can be used in any C<.tlpsrc> files. The names of these -# variables all start with C<global_>. +# variables all start with C<global_>, except for super-special ${wndws}. # # =cut # (all doc at bottom, let's not rewrite now.) @@ -618,7 +623,7 @@ sub find_default_patterns { # check defined variables to ensure their names start with "global_". my %gvars = %{$tlsrc->_tlpvars}; for my $v (keys %gvars) { - if ($v !~ /^global_[-_a-zA-Z0-9]+$/) { + if ($v !~ /^(global_[-_a-zA-Z0-9]+|wndws)$/) { tlwarn("$apfile: variable does not start with global_: $v\n") unless $v eq "PKGNAME"; # the auto-defined PKGNAME is not expected to be global. @@ -972,9 +977,10 @@ definition and expansion.) Ordinarily, variables can be used only within the C<.tlpsrc> file where they are defined. There is one exception: global tlpsrc variables can be defined in the C<00texlive.autopatterns.tlpsrc> file (mentioned below); -their names must start with C<global_>, and can only be used in -C<depend> and C<execute> directives, or another C<tlpsetvar>. For -example, our C<autopatterns.tlpsrc> defines: +their names must start with C<global_> (plus super-special C<wndws>), +and can only be used in C<depend>, C<execute>, and C<...pattern> +directives, another C<tlpsetvar>. For example, our +C<autopatterns.tlpsrc> defines: tlpsetvar global_latex_deps babel,cm,hyphen-base,latex-fonts |