summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/bin/win32/runscript.tlu16
-rwxr-xr-xMaster/install-tl20
-rwxr-xr-xMaster/install-tl-windows.bat6
3 files changed, 40 insertions, 2 deletions
diff --git a/Master/bin/win32/runscript.tlu b/Master/bin/win32/runscript.tlu
index 8f705c87902..b55eac1876a 100755
--- a/Master/bin/win32/runscript.tlu
+++ b/Master/bin/win32/runscript.tlu
@@ -471,7 +471,15 @@ local scripts4tlperl = {
local try_extern_perl = (kpse.var_value('TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL') == '1') and
not (guimode or is_restricted_progname or scripts4tlperl[progname])
local PERLEXE = try_extern_perl and search_path('perl.exe', PATH)
-if not PERLEXE then
+local extperl_warn
+if not PERLEXE then
+ if try_extern_perl then extperl_warn = [[
+External Perl missing or outdated. Please install a recent Perl, or configure
+TeX Live to always use the builtin Perl:
+ tlmgr conf texmf TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL 0
+Meanwhile, continuing with built-in Perl...
+]]
+ end -- if try_extern_perl
PERLEXE = TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
PATH = prepend_path(PATH, TEXDIR..'/tlpkg/tlperl/bin')
@@ -662,6 +670,10 @@ end
if ARGV then
table.insert(ARGV, argline) -- pass through original arguments
+ if string.find (table.concat(ARGV, ' '), 'perl.exe') and extperl_warn then
+
+ io.stderr:write(extperl_warn)
+ end
local ret = assert(os.spawn(ARGV))
if ret ~= 0 then
local dbginfo = debug.getinfo(1)
@@ -687,6 +699,6 @@ if not success then
end
-- about RUNSCRIPT_ERROR_MESSAGE environment variable:
--- it stores an error message that is catched and displayed
+-- it stores an error message that is caught and displayed
-- in a message box on the C side at process exit
-- (currently used only by gui mode stubs)
diff --git a/Master/install-tl b/Master/install-tl
index 85b7a9f8df2..b9b3a7cbc78 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -1153,6 +1153,26 @@ shell_escape = 0
EOF
;
}
+
+ # external perl for third-party scripts?
+ # the wrapper batchfile has set the environment variable extperl
+ # to its version if available and 0 otherwise.
+ if (win32) {
+ my $use_ext = 0;
+ if (!$vars{'portable'} &&
+ defined $ENV{'extperl'} && $ENV{'extperl'} =~ /^(\d+\.\d+)/) {
+ $use_ext = 1 if $1 >= 5.14;
+ }
+ print TMF <<EOF;
+
+% Prefer external Perl for third-party TeXLive Perl scripts
+% Was set to 1 if at install time a sufficiently recent Perl was detected.
+EOF
+;
+ print TMF "TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = " . $use_ext;
+ log("Configuring for using external perl for third-party scripts\n")
+ }
+
close(TMF) || warn "close($TMF) failed: $!";
$TMFLUA = ">$vars{'TEXDIR'}/texmfcnf.lua";
diff --git a/Master/install-tl-windows.bat b/Master/install-tl-windows.bat
index 1fe05af0867..ac6ed7904fa 100755
--- a/Master/install-tl-windows.bat
+++ b/Master/install-tl-windows.bat
@@ -12,6 +12,12 @@ if not ^x==x goto DOS
rem Localize environment changes
setlocal enableextensions
+rem version of external perl, if any
+set extperl=0
+for /f "usebackq tokens=2 delims='" %%a in (`perl -V:version 2^>NUL`) do (
+ set extperl=%%a
+)
+
rem Batch subroutines require a cd to the batchfile directory.
rem For UNC paths, pushd will create a temporary mapping.
pushd "%~dp0"