From d3d93bc4f0d21a259fdafee5ba1a744999474c28 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 10 Aug 2021 13:15:31 +0200 Subject: 2021-08-10 12:39:00 --- tex/context/base/mkiv/grph-fil.lua | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'tex/context/base/mkiv/grph-fil.lua') diff --git a/tex/context/base/mkiv/grph-fil.lua b/tex/context/base/mkiv/grph-fil.lua index 1044d29d9..2cf2a54cc 100644 --- a/tex/context/base/mkiv/grph-fil.lua +++ b/tex/context/base/mkiv/grph-fil.lua @@ -90,7 +90,21 @@ local function analyzed(name) } end -function jobfiles.run(action) +function jobfiles.run(name,action) + local kind = type(name) + if kind == "string" then + local usedname = addsuffix(name,inputsuffix) + action = { + filename = usedname, + action = action, + resultfile = replacesuffix(usedname,resultsuffix), + } + elseif kind == "table" then + action = name + else + report_run("invalid specification for jobfiles.run") + return + end local filename = action.filename local result = action.result local oldchecksum = collected[filename] @@ -121,7 +135,17 @@ function jobfiles.run(action) end end if tobedone then - runner(action) + kind = type(action) + if kind == "function" then + action(filename) + elseif kind == "string" and action ~= "" then + -- can be anything but we assume it gets checked by the sandbox + os.execute(action) + elseif kind == "table" then + runner(action) + else + report_run("processing file, no action given for processing %a",name) + end elseif trace_run then report_run("processing file, no changes in %a, not processed",name) end -- cgit v1.2.3