diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/grph-fil.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/grph-fil.lua | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/grph-fil.lua b/Master/texmf-dist/tex/context/base/grph-fil.lua index 0856f5b0854..1ec88b487fe 100644 --- a/Master/texmf-dist/tex/context/base/grph-fil.lua +++ b/Master/texmf-dist/tex/context/base/grph-fil.lua @@ -12,6 +12,8 @@ local trace_run = false trackers.register("graphic.runfile",function(v) trace_r local report_run = logs.reporter("graphics","run") +-- this code will move + local allocate = utilities.storage.allocate local collected = allocate() @@ -33,17 +35,20 @@ job.register('job.files.collected', tobesaved, initializer) jobfiles.forcerun = false -function jobfiles.run(name,command) +function jobfiles.run(name,action) local oldchecksum = collected[name] local newchecksum = file.checksum(name) if jobfiles.forcerun or not oldchecksum or oldchecksum ~= newchecksum then if trace_run then report_run("processing file, changes in '%s', processing forced",name) end - if command and command ~= "" then - os.execute(command) + local ta = type(action) + if ta == "function" then + action(name) + elseif ta == "string" and action ~= "" then + os.execute(action) else - report_run("processing file, no command given for processing '%s'",name) + report_run("processing file, no action given for processing '%s'",name) end elseif trace_run then report_run("processing file, no changes in '%s', not processed",name) @@ -51,6 +56,8 @@ function jobfiles.run(name,command) tobesaved[name] = newchecksum end +-- + function jobfiles.context(name,options) if type(name) == "table" then local result = { } |