From b0546129eb76b1ec48f1513a127032e0ca907a52 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 9 Apr 2013 10:45:00 +0200 Subject: beta 2013.04.09 10:45 --- scripts/context/lua/mtx-context.lua | 26 +++++++++++++++++--------- scripts/context/lua/mtx-context.xml | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index add21fc90..fd4fe8af3 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -1023,8 +1023,13 @@ end -- touching files (signals regeneration of formats) -local function touch(name,versionpattern,kind,kindpattern) - local name = resolvers.findfile(name) +local function touch(path,name,versionpattern,kind,kindpattern) + if path and path ~= "" then + name = file.join(path,name) +print(name) + else + name = resolvers.findfile(name) + end local olddata = io.loaddata(name) if olddata then local oldkind, newkind = "", kind or "" @@ -1056,16 +1061,18 @@ local p_contextkind = "(\\edef\\contextkind%s*{)(.-)(})" local p_contextversion = "(\\edef\\contextversion%s*{)(.-)(})" local p_newcontextversion = "(\\newcontextversion%s*{)(.-)(})" -local function touchfiles(suffix,kind) - local foundname, oldversion, newversion, oldkind, newkind = touch(file.addsuffix("context",suffix),p_contextversion,kind,p_contextkind) +local function touchfiles(suffix,kind,path) + local foundname, oldversion, newversion, oldkind, newkind = touch(path,file.addsuffix("context",suffix),p_contextversion,kind,p_contextkind) if foundname then report("old version : %s (%s)",oldversion,oldkind) report("new version : %s (%s)",newversion,newkind) report("touched file : %s",foundname) - local foundname = touch(file.addsuffix("cont-new",suffix),p_newcontextversion) + local foundname = touch(path,file.addsuffix("cont-new",suffix),p_newcontextversion) if foundname then report("touched file : %s", foundname) end + else + report("nothing touched") end end @@ -1073,12 +1080,13 @@ function scripts.context.touch() if getargument("expert") then local touch = getargument("touch") local kind = getargument("kind") + local path = getargument("basepath") if touch == "mkii" or touch == "mkiv" or touch == "mkvi" then -- mkix mkxi - touchfiles(touch,kind) + touchfiles(touch,kind,path) else - touchfiles("mkii",kind) - touchfiles("mkiv",kind) - touchfiles("mkvi",kind) + touchfiles("mkii",kind,path) + touchfiles("mkiv",kind,path) + touchfiles("mkvi",kind,path) end else report("touching needs --expert") diff --git a/scripts/context/lua/mtx-context.xml b/scripts/context/lua/mtx-context.xml index 6eb8afeb1..a3812288f 100644 --- a/scripts/context/lua/mtx-context.xml +++ b/scripts/context/lua/mtx-context.xml @@ -141,7 +141,7 @@ - update context version number (remake needed afterwards, also provide ) + update context version number (also provide , optionally provide ) omit runtime statistics at the end of the run -- cgit v1.2.3