diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index ed5e7380fcf..6ccda6d597a 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -1361,12 +1361,23 @@ sub _do_postaction_script { return 0; } my $file = $keyval{'file'}; - my $filew = $file; - $filew = $keyval{'filew32'} if defined($keyval{'filew32'}); + if (win32() && defined($keyval{'filew32'})) { + $file = $keyval{'filew32'}; + } my $texdir = `kpsewhich -var-value=SELFAUTOPARENT`; chomp($texdir); my @syscmd; - push @syscmd, (win32() ? "$texdir/$filew" : "$texdir/$file"), $texdir, $how; + if ($file =~ m/\.pl$/i) { + # we got a perl script, call it via perl + push @syscmd, "perl", "$texdir/$file"; + } elsif ($file =~ m/\.texlua$/i) { + # we got a texlua script, call it via texlua + push @syscmd, "texlua", "$texdir/$file"; + } else { + # we got anything else, call it directly and hope it is excutable + push @syscmd, "$texdir/$file"; + } + push @syscmd, $how, $texdir; my $ret = system (@syscmd); if ($ret != 0) { $ret /= 256 if $ret > 0; |