diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 22 | ||||
-rw-r--r-- | scripts/context/lua/mtx-metatex.lua | 80 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 7 | ||||
-rw-r--r-- | scripts/context/perl/mptopdf.pl | 24 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/metatex.exe | bin | 4608 -> 0 bytes | |||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 7 | ||||
-rw-r--r-- | scripts/context/stubs/unix/metatex | 2 | ||||
-rw-r--r-- | scripts/context/stubs/unix/mtxrun | 7 | ||||
-rw-r--r-- | scripts/context/stubs/win64/metatex.exe | bin | 15360 -> 0 bytes | |||
-rw-r--r-- | scripts/context/stubs/win64/mtxrun.lua | 7 |
10 files changed, 45 insertions, 111 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 2d93b8094..c50c4a77a 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -103,17 +103,17 @@ end -- -- The way we use stubs will change in a bit in 2019 (mtxrun and context). We also normalize -- -- the platforms to use a similar approach to this. --- --- local engine_new = file.nameonly(getargument("engine") or directives.value("system.engine")) --- local engine_old = file.nameonly(environment.ownbin) --- --- local function restart(engine_old,engine_new) --- local command = format("%s --luaonly %q %s --redirected",engine_new,environment.ownname,environment.reconstructcommandline()) --- report(format("redirect %s -> %s: %s",engine_old,engine_new,command)) --- local result = os.execute(command) --- os.exit(result == 0 and 0 or 1) --- end --- + +local engine_new = file.nameonly(getargument("engine") or directives.value("system.engine")) +local engine_old = file.nameonly(environment.ownbin) + +local function restart(engine_old,engine_new) + local command = format("%s --luaonly %q %s --redirected",engine_new,environment.ownname,environment.reconstructcommandline()) + report(format("redirect %s -> %s: %s",engine_old,engine_new,command)) + local result = os.execute(command) + os.exit(result == 0 and 0 or 1) +end + -- if getargument("redirected") then -- setargument("engine",engine_old) -- later on we need this -- elseif engine_new == engine_old then diff --git a/scripts/context/lua/mtx-metatex.lua b/scripts/context/lua/mtx-metatex.lua deleted file mode 100644 index 455ecbd52..000000000 --- a/scripts/context/lua/mtx-metatex.lua +++ /dev/null @@ -1,80 +0,0 @@ -if not modules then modules = { } end modules ['mtx-metatex'] = { - version = 1.001, - comment = "companion to mtxrun.lua", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- future versions will deal with specific variants of metatex - -local helpinfo = [[ -<?xml version="1.0"?> -<application> - <metadata> - <entry name="name">mtx-metatex</entry> - <entry name="detail">MetaTeX Process Management</entry> - <entry name="version">0.10</entry> - </metadata> - <flags> - <category name="basic"> - <subcategory> - <flag name="run"><short>process (one or more) files (default action)</short></flag> - <flag name="make"><short>create metatex format(s)</short></flag> - </subcategory> - </category> - </flags> -</application> -]] - -local application = logs.application { - name = "mtx-metatex", - banner = "MetaTeX Process Management 0.10", - helpinfo = helpinfo, -} - -local report = application.report - -scripts = scripts or { } -scripts.metatex = scripts.metatex or { } - --- metatex - -function scripts.metatex.make() - environment.make_format("metatex") -end - -function scripts.metatex.run(ctxdata,filename) - local filename = environment.files[1] or "" - if filename ~= "" then - local formatfile, scriptfile = resolvers.locateformat("metatex") - if formatfile and scriptfile then - local command = string.format("luatex --fmt=%s --lua=%s %s", - string.quote(formatfile), string.quote(scriptfile), string.quote(filename)) - report("running command: %s",command) - os.spawn(command) - elseif formatname then - report("error, no format found with name: %s",formatname) - else - report("error, no format found (provide formatname or interface)") - end - end -end - -function scripts.metatex.timed(action) - statistics.timed(action) -end - -if environment.argument("run") then - scripts.metatex.timed(scripts.metatex.run) -elseif environment.argument("make") then - scripts.metatex.timed(scripts.metatex.make) -elseif environment.argument("help") then - logs.help(messages.help,false) -elseif environment.argument("exporthelp") then - application.export(environment.argument("exporthelp"),environment.files[1]) -elseif environment.files[1] then - scripts.metatex.timed(scripts.metatex.run) -else - application.help() -end diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 8f8448c85..55bfdef41 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -6310,7 +6310,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 43101, stripped down to: 21622 +-- original size: 43539, stripped down to: 21641 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6667,6 +6667,7 @@ local environment={ formattedfloat=number.formattedfloat, stripzero=lpeg.patterns.stripzero, stripzeros=lpeg.patterns.stripzeros, + FORMAT=string.f9, } local arguments={ "a1" } setmetatable(arguments,{ __index=function(t,k) @@ -24754,8 +24755,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 989156 --- stripped bytes : 393037 +-- original bytes : 989594 +-- stripped bytes : 393456 -- end library merge diff --git a/scripts/context/perl/mptopdf.pl b/scripts/context/perl/mptopdf.pl index 42db9001e..165d4d217 100644 --- a/scripts/context/perl/mptopdf.pl +++ b/scripts/context/perl/mptopdf.pl @@ -118,9 +118,14 @@ if (($pattern eq '')||($Help)) { @files = glob "$pattern" ; } +# this patch was send via debian but is not tested by me + foreach my $file (@files) { $_ = $file ; - if (s/\.(\d+|mps)$// && -e $file) { + # if (s/\.(\d+|mps)$// && -e $file) { + if (s/\.(\d+|mps|ps)$// && -e $file) { + my $suffix = $1 ; + my $pdf = basename($_).".pdf" ; if ($miktex) { $command = "pdftex -undump=mptopdf" ; } else { @@ -136,15 +141,22 @@ foreach my $file (@files) { print "\n$program : error while processing tex file\n" ; exit 1 ; } - my $pdfsrc = basename($_).".pdf"; - rename ($pdfsrc, "$_-$1.pdf") ; - if (-e $pdfsrc) { - CopyFile ($pdfsrc, "$_-$1.pdf") ; + # my $pdfsrc = basename($_).".pdf"; + # rename ($pdfsrc, "$_-$1.pdf") ; + # if (-e $pdfsrc) { + # CopyFile ($pdfsrc, "$_-$1.pdf") ; + if ($suffix =~ m/\.\d+$/) { + rename ($pdf, "$_-$suffix.pdf") ; + if (-e $pdf) { + CopyFile ($pdf, "$_-$suffix.pdf") ; + } + $pdf = "$_-$suffix.pdf" ; } if ($done) { $report .= " +" ; } - $report .= " $_-$1.pdf" ; + # $report .= " $_-$1.pdf" ; + $report .= " $pdf" ; ++$done ; } } diff --git a/scripts/context/stubs/mswin/metatex.exe b/scripts/context/stubs/mswin/metatex.exe Binary files differdeleted file mode 100644 index 0e7882cf9..000000000 --- a/scripts/context/stubs/mswin/metatex.exe +++ /dev/null diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 8f8448c85..55bfdef41 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -6310,7 +6310,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 43101, stripped down to: 21622 +-- original size: 43539, stripped down to: 21641 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6667,6 +6667,7 @@ local environment={ formattedfloat=number.formattedfloat, stripzero=lpeg.patterns.stripzero, stripzeros=lpeg.patterns.stripzeros, + FORMAT=string.f9, } local arguments={ "a1" } setmetatable(arguments,{ __index=function(t,k) @@ -24754,8 +24755,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 989156 --- stripped bytes : 393037 +-- original bytes : 989594 +-- stripped bytes : 393456 -- end library merge diff --git a/scripts/context/stubs/unix/metatex b/scripts/context/stubs/unix/metatex deleted file mode 100644 index f0c6b65d4..000000000 --- a/scripts/context/stubs/unix/metatex +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mtxrun --script metatex "$@" diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 8f8448c85..55bfdef41 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -6310,7 +6310,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 43101, stripped down to: 21622 +-- original size: 43539, stripped down to: 21641 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6667,6 +6667,7 @@ local environment={ formattedfloat=number.formattedfloat, stripzero=lpeg.patterns.stripzero, stripzeros=lpeg.patterns.stripzeros, + FORMAT=string.f9, } local arguments={ "a1" } setmetatable(arguments,{ __index=function(t,k) @@ -24754,8 +24755,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 989156 --- stripped bytes : 393037 +-- original bytes : 989594 +-- stripped bytes : 393456 -- end library merge diff --git a/scripts/context/stubs/win64/metatex.exe b/scripts/context/stubs/win64/metatex.exe Binary files differdeleted file mode 100644 index 93290a6e0..000000000 --- a/scripts/context/stubs/win64/metatex.exe +++ /dev/null diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 8f8448c85..55bfdef41 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -6310,7 +6310,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 43101, stripped down to: 21622 +-- original size: 43539, stripped down to: 21641 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6667,6 +6667,7 @@ local environment={ formattedfloat=number.formattedfloat, stripzero=lpeg.patterns.stripzero, stripzeros=lpeg.patterns.stripzeros, + FORMAT=string.f9, } local arguments={ "a1" } setmetatable(arguments,{ __index=function(t,k) @@ -24754,8 +24755,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 989156 --- stripped bytes : 393037 +-- original bytes : 989594 +-- stripped bytes : 393456 -- end library merge |