From 350d02c562cc18435ef0c3b941ccbad880281239 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 5 May 2009 08:19:49 +0000 Subject: support perl and texlua script in the postaction code thingy git-svn-id: svn://tug.org/texlive/branches/branch2009-dev@12930 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 17 ++++++++++++++--- 1 file 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; -- cgit v1.2.3