summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2014-01-30 23:40:15 +0200
committerMarius <mariausol@gmail.com>2014-01-30 23:40:15 +0200
commitb8b8e1819a1a3e327c26b3c758bdf0dd4a5f88e0 (patch)
tree5ed13e7888a7e383d68ca08d94f385574a3dd02f /scripts
parentbed521c2be2cfc35e739e13d03ba171417a04453 (diff)
downloadcontext-b8b8e1819a1a3e327c26b3c758bdf0dd4a5f88e0.tar.gz
beta 2014.01.30 22:19
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-context.lua28
1 files changed, 19 insertions, 9 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index 9b620603e..90efb5225 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -256,8 +256,9 @@ end
-- multipass control
-local multipass_suffixes = { ".tuc" }
-local multipass_nofruns = 8 -- or 7 to test oscillation
+local multipass_suffixes = { ".tuc" }
+local multipass_nofruns = 8 -- or 7 to test oscillation
+local multipass_forcedruns = false
local function multipass_hashfiles(jobname)
local hash = { }
@@ -693,6 +694,7 @@ function scripts.context.run(ctxdata,filename)
c_flags.final = false
c_flags.kindofrun = (a_once and 3) or (currentrun==1 and 1) or (currentrun==maxnofruns and 4) or 2
c_flags.maxnofruns = maxnofruns
+ c_flags.forcedruns = multipass_forcedruns and multipass_forcedruns > 0 and multipass_forcedruns or nil
c_flags.currentrun = currentrun
c_flags.noarrange = a_noarrange or a_arrange or nil
--
@@ -710,10 +712,15 @@ function scripts.context.run(ctxdata,filename)
break
elseif returncode == 0 then
multipass_copyluafile(jobname)
- newhash = multipass_hashfiles(jobname)
- if multipass_changed(oldhash,newhash) then
- oldhash = newhash
- else
+ if not multipass_forcedruns then
+ newhash = multipass_hashfiles(jobname)
+ if multipass_changed(oldhash,newhash) then
+ oldhash = newhash
+ else
+ break
+ end
+ elseif currentrun == multipass_forcedruns then
+ report("quitting after force %i runs",multipass_forcedruns)
break
end
else
@@ -1481,9 +1488,12 @@ do
end
if getargument("once") then
- multipass_nofruns = 1
-elseif getargument("runs") then
- multipass_nofruns = tonumber(getargument("runs")) or nil
+ multipass_nofruns = 1
+else
+ if getargument("runs") then
+ multipass_nofruns = tonumber(getargument("runs")) or nil
+ end
+ multipass_forcedruns = tonumber(getargument("forcedruns")) or nil
end
if getargument("run") then