summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/grph-fil.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/grph-fil.lua')
-rw-r--r--tex/context/base/mkiv/grph-fil.lua28
1 files changed, 26 insertions, 2 deletions
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