diff options
author | Piotr Strzelczyk <piotr@eps.gda.pl> | 2010-06-04 00:03:13 +0000 |
---|---|---|
committer | Piotr Strzelczyk <piotr@eps.gda.pl> | 2010-06-04 00:03:13 +0000 |
commit | 7a836119031588b0cef69d5e819334d7e4cf9a02 (patch) | |
tree | ef07d28f8761ee928ec7d5ad5255fab82d5502f6 /Build | |
parent | 1c77159f37f91778c98204a071638c4bf57eeb27 (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 'Build')
-rw-r--r-- | Build/source/texk/texlive/w32_wrapper/readme.txt | 3 | ||||
-rw-r--r-- | Build/source/texk/texlive/w32_wrapper/runscript.tlu | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Build/source/texk/texlive/w32_wrapper/readme.txt b/Build/source/texk/texlive/w32_wrapper/readme.txt index e5fcf746721..889b737bee2 100644 --- a/Build/source/texk/texlive/w32_wrapper/readme.txt +++ b/Build/source/texk/texlive/w32_wrapper/readme.txt @@ -188,4 +188,7 @@ - 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 (#!) diff --git a/Build/source/texk/texlive/w32_wrapper/runscript.tlu b/Build/source/texk/texlive/w32_wrapper/runscript.tlu index 396f81a1da6..64496ca11ab 100644 --- a/Build/source/texk/texlive/w32_wrapper/runscript.tlu +++ b/Build/source/texk/texlive/w32_wrapper/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
|