summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/texlive/w32_wrapper/readme.txt3
-rw-r--r--Build/source/texk/texlive/w32_wrapper/runscript.tlu9
-rw-r--r--Master/bin/win32/runscript.tlu9
3 files changed, 19 insertions, 2 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
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