From a88d77afdd9ea519815a25698e446908aec42ff9 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 3 Dec 2009 00:41:00 +0100 Subject: beta 2009.12.03 00:41 --- scripts/context/lua/mtx-context.lua | 17 ++++++++++++----- scripts/context/lua/mtxrun.lua | 15 ++++++++++----- scripts/context/stubs/mswin/context.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/mswin/luatools.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/mswin/metatex.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/mswin/mtxrun.dll | Bin 7679 -> 7680 bytes scripts/context/stubs/mswin/mtxrun.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/mswin/mtxrun.lua | 15 ++++++++++----- scripts/context/stubs/mswin/mtxworks.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/mswin/texexec.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/mswin/texmfstart.exe | Bin 5631 -> 5633 bytes scripts/context/stubs/unix/mtxrun | 15 ++++++++++----- 12 files changed, 42 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index c6d15a1b0..40ab67eff 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -674,11 +674,18 @@ function scripts.context.run(ctxdata,filename) -- look at the first line local a = analyze(filename) if a and (a.engine == 'pdftex' or a.engine == 'xetex' or environment.argument("pdftex") or environment.argument("xetex")) then - local texexec = resolvers.find_file("texexec.rb") or "" - if texexec ~= "" then - os.setenv("RUBYOPT","") - local command = string.format("ruby %s %s",texexec,environment.reconstruct_commandline(environment.arguments_after)) - os.exec(command) + if false then + -- we need to write a top etc too and run mp etc so it's not worth the + -- trouble, so it will take a while before the next is finished + -- + -- require "mtx-texutil.lua" + else + local texexec = resolvers.find_file("texexec.rb") or "" + if texexec ~= "" then + os.setenv("RUBYOPT","") + local command = string.format("ruby %s %s",texexec,environment.reconstruct_commandline(environment.arguments_after)) + os.exec(command) + end end else if a and a.interface and a.interface ~= interface then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 8e2524147..a1fc6eaf5 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -10750,10 +10750,11 @@ messages.help = [[ --edit launch editor with found file --launch (--all) launch files like manuals, assumes os support ---intern run script using built in libraries +--internal run script using built in libraries (same as --ctxlua) +--timedrun run a script an time its run ---usekpse use kpse as fallback (when no mkiv and cache installed, often slower) ---forcekpse force using kpse (handy when no mkiv and cache installed but less functionality) +--usekpse use kpse as fallback (when no mkiv and cache installed, often slower) +--forcekpse force using kpse (handy when no mkiv and cache installed but less functionality) ]] runners.applications = { @@ -11137,7 +11138,8 @@ function runners.find_mtx_script(filename) return fullname end -function runners.execute_ctx_script(filename,arguments) +function runners.execute_ctx_script(filename) + local arguments = environment.arguments_after local fullname = runners.find_mtx_script(filename) or "" -- retyr after generate but only if --autogenerate if fullname == "" and environment.argument("autogenerate") then -- might become the default @@ -11337,7 +11339,7 @@ elseif environment.argument("ctxlua") or environment.argument("internal") then ok = runners.execute_script(filename,true) elseif environment.argument("script") or environment.argument("s") then -- run a script by loading it (using libs), pass args - ok = runners.execute_ctx_script(filename,after) + ok = runners.execute_ctx_script(filename) elseif environment.argument("execute") then -- execute script ok = runners.execute_script(filename) @@ -11374,6 +11376,9 @@ elseif filename:find("^bin:") then ok = runners.execute_program(filename) else ok = runners.execute_script(filename) + if not ok then + ok = runners.execute_ctx_script(filename) + end end if os.platform == "unix" then diff --git a/scripts/context/stubs/mswin/context.exe b/scripts/context/stubs/mswin/context.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/context.exe and b/scripts/context/stubs/mswin/context.exe differ diff --git a/scripts/context/stubs/mswin/luatools.exe b/scripts/context/stubs/mswin/luatools.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/luatools.exe and b/scripts/context/stubs/mswin/luatools.exe differ diff --git a/scripts/context/stubs/mswin/metatex.exe b/scripts/context/stubs/mswin/metatex.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/metatex.exe and b/scripts/context/stubs/mswin/metatex.exe differ diff --git a/scripts/context/stubs/mswin/mtxrun.dll b/scripts/context/stubs/mswin/mtxrun.dll index 4c4dfbf66..6af687abe 100644 Binary files a/scripts/context/stubs/mswin/mtxrun.dll and b/scripts/context/stubs/mswin/mtxrun.dll differ diff --git a/scripts/context/stubs/mswin/mtxrun.exe b/scripts/context/stubs/mswin/mtxrun.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/mtxrun.exe and b/scripts/context/stubs/mswin/mtxrun.exe differ diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 8e2524147..a1fc6eaf5 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -10750,10 +10750,11 @@ messages.help = [[ --edit launch editor with found file --launch (--all) launch files like manuals, assumes os support ---intern run script using built in libraries +--internal run script using built in libraries (same as --ctxlua) +--timedrun run a script an time its run ---usekpse use kpse as fallback (when no mkiv and cache installed, often slower) ---forcekpse force using kpse (handy when no mkiv and cache installed but less functionality) +--usekpse use kpse as fallback (when no mkiv and cache installed, often slower) +--forcekpse force using kpse (handy when no mkiv and cache installed but less functionality) ]] runners.applications = { @@ -11137,7 +11138,8 @@ function runners.find_mtx_script(filename) return fullname end -function runners.execute_ctx_script(filename,arguments) +function runners.execute_ctx_script(filename) + local arguments = environment.arguments_after local fullname = runners.find_mtx_script(filename) or "" -- retyr after generate but only if --autogenerate if fullname == "" and environment.argument("autogenerate") then -- might become the default @@ -11337,7 +11339,7 @@ elseif environment.argument("ctxlua") or environment.argument("internal") then ok = runners.execute_script(filename,true) elseif environment.argument("script") or environment.argument("s") then -- run a script by loading it (using libs), pass args - ok = runners.execute_ctx_script(filename,after) + ok = runners.execute_ctx_script(filename) elseif environment.argument("execute") then -- execute script ok = runners.execute_script(filename) @@ -11374,6 +11376,9 @@ elseif filename:find("^bin:") then ok = runners.execute_program(filename) else ok = runners.execute_script(filename) + if not ok then + ok = runners.execute_ctx_script(filename) + end end if os.platform == "unix" then diff --git a/scripts/context/stubs/mswin/mtxworks.exe b/scripts/context/stubs/mswin/mtxworks.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/mtxworks.exe and b/scripts/context/stubs/mswin/mtxworks.exe differ diff --git a/scripts/context/stubs/mswin/texexec.exe b/scripts/context/stubs/mswin/texexec.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/texexec.exe and b/scripts/context/stubs/mswin/texexec.exe differ diff --git a/scripts/context/stubs/mswin/texmfstart.exe b/scripts/context/stubs/mswin/texmfstart.exe index 8f3ad2eea..9a67fc133 100755 Binary files a/scripts/context/stubs/mswin/texmfstart.exe and b/scripts/context/stubs/mswin/texmfstart.exe differ diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 8e2524147..a1fc6eaf5 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -10750,10 +10750,11 @@ messages.help = [[ --edit launch editor with found file --launch (--all) launch files like manuals, assumes os support ---intern run script using built in libraries +--internal run script using built in libraries (same as --ctxlua) +--timedrun run a script an time its run ---usekpse use kpse as fallback (when no mkiv and cache installed, often slower) ---forcekpse force using kpse (handy when no mkiv and cache installed but less functionality) +--usekpse use kpse as fallback (when no mkiv and cache installed, often slower) +--forcekpse force using kpse (handy when no mkiv and cache installed but less functionality) ]] runners.applications = { @@ -11137,7 +11138,8 @@ function runners.find_mtx_script(filename) return fullname end -function runners.execute_ctx_script(filename,arguments) +function runners.execute_ctx_script(filename) + local arguments = environment.arguments_after local fullname = runners.find_mtx_script(filename) or "" -- retyr after generate but only if --autogenerate if fullname == "" and environment.argument("autogenerate") then -- might become the default @@ -11337,7 +11339,7 @@ elseif environment.argument("ctxlua") or environment.argument("internal") then ok = runners.execute_script(filename,true) elseif environment.argument("script") or environment.argument("s") then -- run a script by loading it (using libs), pass args - ok = runners.execute_ctx_script(filename,after) + ok = runners.execute_ctx_script(filename) elseif environment.argument("execute") then -- execute script ok = runners.execute_script(filename) @@ -11374,6 +11376,9 @@ elseif filename:find("^bin:") then ok = runners.execute_program(filename) else ok = runners.execute_script(filename) + if not ok then + ok = runners.execute_ctx_script(filename) + end end if os.platform == "unix" then -- cgit v1.2.3