diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-01-30 22:19:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-01-30 22:19:00 +0100 |
commit | 1eeba18f2774f07591373519a17b61b4b2bea59d (patch) | |
tree | 073e36859538b8860ebc385b797e48f62155f3ca /scripts | |
parent | c04ccb8a10e06796d315d1faf94f4c5854fb02a3 (diff) | |
download | context-1eeba18f2774f07591373519a17b61b4b2bea59d.tar.gz |
beta 2014.01.30 22:19
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 28 |
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 |