diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-13 23:12:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-13 23:12:47 +0000 |
commit | c74725ee58bb59d1fd6f82c78dac54033b642839 (patch) | |
tree | 1e183730badee22123f15ac05c4178aa6d1b7d05 /Build/source/texk/tests | |
parent | 02d4e889660e0ee9ef39151c47c6434217e8244e (diff) |
doc,sync
git-svn-id: svn://tug.org/texlive/trunk@49408 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tests')
-rw-r--r-- | Build/source/texk/tests/TeXLive/TLUtils.pm | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm index cd9160f6804..6c30198cff2 100644 --- a/Build/source/texk/tests/TeXLive/TLUtils.pm +++ b/Build/source/texk/tests/TeXLive/TLUtils.pm @@ -5,7 +5,7 @@ package TeXLive::TLUtils; -my $svnrev = '$Revision: 49173 $'; +my $svnrev = '$Revision: 49226 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -2327,7 +2327,7 @@ sub read_file_ignore_cr { } -=item C<setup_programs($bindir, $platform)> +=item C<setup_programs($bindir, $platform, $tlfirst)> Populate the global C<$::progs> hash containing the paths to the programs C<lz4>, C<tar>, C<wget>, C<xz>. The C<$bindir> argument specifies @@ -2336,6 +2336,10 @@ gives the TeX Live platform name, used as the extension on our executables. If a program is not present in the TeX Live tree, we also check along PATH (without the platform extension.) +If the C<$tlfirst> argument or the C<TEXLIVE_PREFER_OWN> envvar is set, +prefer TL versions; else prefer system versions (except for Windows +C<tar.exe>, where we always use ours). + Check many different downloads and compressors to determine what is working. @@ -2347,6 +2351,18 @@ sub setup_programs { my ($bindir, $platform, $tlfirst) = @_; my $ok = 1; + # tlfirst is (currently) not passed in by either the installer or + # tlmgr, so it will be always false. + # If it is not defined, we check for the env variable + # TEXLIVE_PREFER_OWN + # + if (!defined($tlfirst)) { + if ($ENV{'TEXLIVE_PREFER_OWN'}) { + debug("setup_programs: TEXLIVE_PREFER_OWN is set!\n"); + $tlfirst = 1; + } + } + debug("setup_programs: preferring " . ($tlfirst ? "TL" : "system") . " versions\n"); my $isWin = ($^O =~ /^MSWin/i); @@ -2380,10 +2396,13 @@ sub setup_programs { } $::progs{'working_downloaders'} = [ @working_downloaders ]; my @working_compressors; - for my $defprog (sort {$Compressors{$a}{'priority'} <=> $Compressors{$b}{'priority'}} keys %Compressors) { + for my $defprog (sort + { $Compressors{$a}{'priority'} <=> $Compressors{$b}{'priority'} } + keys %Compressors) { # do not warn on errors if (setup_one(($isWin ? "w32" : "unix"), $defprog, - "$bindir/$defprog/$defprog.$platform", "--version", $tlfirst)) { + "$bindir/$defprog/$defprog.$platform", "--version", + $tlfirst)) { push @working_compressors, $defprog; # also set up $::{'compressor'} if not already done # this selects the first one, but we might reset this depending on @@ -2567,7 +2586,7 @@ into C<$destination>, which can be either a filename of simply C<|>. In the latter case a file handle is returned. Downloading first checks for the environment variable C<TEXLIVE_DOWNLOADER>, -which takes various built-in values. If not set, the next check is fr +which takes various built-in values. If not set, the next check is for C<TL_DOWNLOAD_PROGRAM> and C<TL_DOWNLOAD_ARGS>. The former overrides the above specification devolving to C<wget>, and the latter overrides the default wget arguments. |