diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-08 18:28:14 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-08 18:28:14 +0200 |
commit | e5703477ae326ba910515aeab93000828516954a (patch) | |
tree | 3dcb2ed17154ae4da1418ea250865a9de1cf2eab /scripts | |
parent | a224df6e63d610abc259a79507bc9b2af3657bde (diff) | |
download | context-e5703477ae326ba910515aeab93000828516954a.tar.gz |
2016-05-08 17:35:00
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 35 | ||||
-rw-r--r-- | scripts/context/lua/mtx-modules.lua | 2 |
2 files changed, 24 insertions, 13 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 26d7e008b..a5f01cebc 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -708,9 +708,10 @@ function scripts.context.run(ctxdata,filename) scripts.context.make(formatname) end -- - local oldhash = multipass_hashfiles(jobname) - local newhash = { } - local maxnofruns = once and 1 or multipass_nofruns + local oldhash = multipass_hashfiles(jobname) + local newhash = { } + local maxnofruns = once and 1 or multipass_nofruns + local fulljobname = validstring(filename) -- local c_flags = { directives = directives, -- gets passed via mtxrun @@ -719,7 +720,7 @@ function scripts.context.run(ctxdata,filename) -- result = validstring(resultname), input = validstring(getargument("input") or filename), -- alternative input - fulljobname = validstring(filename), + fulljobname = fulljobname, files = concat(files,","), ctx = validstring(ctxname), export = a_export and true or nil, @@ -850,9 +851,9 @@ function scripts.context.run(ctxdata,filename) end -- if a_purge then - scripts.context.purge_job(jobname) + scripts.context.purge_job(jobname,false,false,fulljobname) elseif a_purgeall then - scripts.context.purge_job(jobname,true) + scripts.context.purge_job(jobname,true,false,fulljobname) end -- if resultname then @@ -866,11 +867,13 @@ function scripts.context.run(ctxdata,filename) report("result renamed to: %s",newbase) end -- - if purge then - scripts.context.purge_job(resultname) - elseif purgeall then - scripts.context.purge_job(resultname,true) - end + -- -- needs checking + -- + -- if a_purge then + -- scripts.context.purge_job(resultname) + -- elseif a_purgeall then + -- scripts.context.purge_job(resultname,true) + -- end -- local pdfview = getargument("autopdf") if pdfview then @@ -1245,6 +1248,9 @@ local temporary_runfiles = { "aux", "blg", -- bibtex } +local temporary_suffixes = { + "prep", -- context preprocessed +} local synctex_runfiles = { "synctex", "synctex.gz", -- synctex } @@ -1273,7 +1279,7 @@ local function purge_file(dfile,cfile) end end -function scripts.context.purge_job(jobname,all,mkiitoo) +function scripts.context.purge_job(jobname,all,mkiitoo,fulljobname) if jobname and jobname ~= "" then jobname = filebasename(jobname) local filebase = removesuffix(jobname) @@ -1287,6 +1293,11 @@ function scripts.context.purge_job(jobname,all,mkiitoo) for i=1,#temporary_runfiles do deleted[#deleted+1] = purge_file(fileaddsuffix(filebase,temporary_runfiles[i])) end + if fulljobname and fulljobname ~= jobname then + for i=1,#temporary_suffixes do + deleted[#deleted+1] = purge_file(fileaddsuffix(fulljobname,temporary_suffixes[i],true)) + end + end if not environment.argument("synctex") then -- special case: not deleted when --synctex is given, but what if given in preamble for i=1,#synctex_runfiles do diff --git a/scripts/context/lua/mtx-modules.lua b/scripts/context/lua/mtx-modules.lua index f4003c1db..572e6a304 100644 --- a/scripts/context/lua/mtx-modules.lua +++ b/scripts/context/lua/mtx-modules.lua @@ -58,7 +58,7 @@ local report = application.report -- \stoptypen -- -- Macro definitions specific to the documentation are not surrounded by --- start-stop commands. The suffix specificaction can be overruled at runtime, +-- start-stop commands. The suffix specification can be overruled at runtime, -- but defaults to the file extension. This specification can be used for language -- depended verbatim typesetting. -- |