summaryrefslogtreecommitdiff
path: root/Master/bin/win32
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2010-06-04 00:03:13 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2010-06-04 00:03:13 +0000
commit7a836119031588b0cef69d5e819334d7e4cf9a02 (patch)
treeef07d28f8761ee928ec7d5ad5255fab82d5502f6 /Master/bin/win32
parent1c77159f37f91778c98204a071638c4bf57eeb27 (diff)
support for Perl scripts starting with eval-exec-perl
git-svn-id: svn://tug.org/texlive/trunk@18711 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/win32')
-rw-r--r--Master/bin/win32/runscript.tlu9
1 files changed, 8 insertions, 1 deletions
diff --git a/Master/bin/win32/runscript.tlu b/Master/bin/win32/runscript.tlu
index 396f81a1da6..64496ca11ab 100644
--- a/Master/bin/win32/runscript.tlu
+++ b/Master/bin/win32/runscript.tlu
@@ -201,6 +201,9 @@ local docstr = [[
- more doc tweaks
2010/05/30
- Windows XP or newer required to run TeXworks
+ 2010/06/04
+ - added support for Perl scripts starting with eval-exec-perl
+ construct in place of she-bang (#!)
]]
-- HELPER SUBROUTINES --
@@ -263,7 +266,11 @@ local function shebang_to_argv(progfullname)
if not fid then return nil, errmsg end
local fstln = fid:read('*line')
fid:close()
- if (string.sub(fstln, 1, 2) ~= '#!') then
+ if string.find(fstln, "eval.*exit.*exec.*perl") then
+ -- special case of Perl's time-honoured "totally devious construct":
+ -- eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+ return {"perl"}
+ elseif (string.sub(fstln, 1, 2) ~= '#!') then
return nil, "don't know how to execute script: "..progfullname
end
local argv = string.explode( string.sub(fstln, 3) ) -- split on spaces