diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2010-05-24 14:05:02 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2010-05-24 14:05:02 +0000 |
commit | 57ea7dad48fbf2541c04e434c31bde655ada3ac4 (patch) | |
tree | 1f8b43bc7cb92939271e1f5bec610710be69097f /Master/texmf-dist/tex/context/base/grph-fil.lua | |
parent | 6ee41e1f1822657f7f23231ec56c0272de3855e3 (diff) |
here is context 2010.05.24 13:05
git-svn-id: svn://tug.org/texlive/trunk@18445 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/grph-fil.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/grph-fil.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/grph-fil.lua b/Master/texmf-dist/tex/context/base/grph-fil.lua new file mode 100644 index 00000000000..2e32c7a6066 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/grph-fil.lua @@ -0,0 +1,42 @@ +if not modules then modules = { } end modules ['grph-fil'] = { + version = 1.001, + comment = "companion to grph-fig.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format, concat = string.format, table.concat + +local trace_run = false trackers.register("files.run",function(v) trace_run = v end) + +local command = "context %s" + +jobfiles = jobfiles or { } +jobfiles.collected = jobfiles.collected or { } +jobfiles.tobesaved = jobfiles.tobesaved or { } + +local tobesaved, collected = jobfiles.tobesaved, jobfiles.collected + +local function initializer() + tobesaved, collected = jobfiles.tobesaved, jobfiles.collected +end + +job.register('jobfiles.collected', jobfiles.tobesaved, initializer) + +jobfiles.forcerun = false + +function jobfiles.run(name,...) + local oldchecksum = collected[name] + local newchecksum = file.checksum(name) + if jobfiles.forcerun or not oldchecksum or oldchecksum ~= newchecksum then + if trace_run then + commands.writestatus("buffers","changes in '%s', processing forced",name) + end + os.execute(format(command,concat({ name, ... }," "))) + elseif trace_run then + commands.writestatus("buffers","no changes in '%s', not processed",name) + end + tobesaved[name] = newchecksum + return file.replacesuffix(name,"pdf") +end |