diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/luatools.lua | 104 | ||||
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 223 | ||||
-rw-r--r-- | scripts/context/lua/mtx-fonts.lua | 10 | ||||
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 103 | ||||
-rw-r--r-- | scripts/context/ruby/ctxtools.rb | 15 |
5 files changed, 394 insertions, 61 deletions
diff --git a/scripts/context/lua/luatools.lua b/scripts/context/lua/luatools.lua index 0eb63c873..e46337223 100644 --- a/scripts/context/lua/luatools.lua +++ b/scripts/context/lua/luatools.lua @@ -1105,8 +1105,12 @@ function file.extname(name) return name:match("^.+%.(.-)$") or "" end -function file.join(...) -- args - return (string.gsub(table.concat({...},"/"),"\\","/")) +function file.join(...) + local t = { ... } + for i=1,#t do + t[i] = (t[i]:gsub("\\","/")):gsub("/+$","") + end + return table.concat(t,"/") end function file.is_writable(name) @@ -1129,16 +1133,31 @@ function file.is_readable(name) end end +--~ function file.split_path(str) +--~ if str:find(';') then +--~ return str:splitchr(";") +--~ else +--~ return str:splitchr(io.pathseparator) +--~ end +--~ end + +-- todo: lpeg + function file.split_path(str) - if str:find(';') then - return str:splitchr(";") - else - return str:splitchr(io.pathseparator) + local t = { } + str = str:gsub("\\", "/") + str = str:gsub("(%a):([;/])", "%1\001%2") + for name in str:gmatch("([^;:]+)") do + if name ~= "" then + name = name:gsub("\001",":") + t[#t+1] = name + end end + return t end function file.join_path(tab) - return table.concat(tab,io.pathseparator) + return table.concat(tab,io.pathseparator) -- can have trailing // end --~ print('test' .. " == " .. file.collapse_path("test")) @@ -1577,7 +1596,14 @@ end function utils.lua.compile(luafile, lucfile) -- utils.report("compiling",luafile,"into",lucfile) os.remove(lucfile) - return (os.execute("luac -s -o " .. string.quote(lucfile) .. " " .. string.quote(luafile)) == 0) + local command = "-s -o " .. string.quote(lucfile) .. " " .. string.quote(luafile) + if os.execute("texluac " .. command) == 0 then + return true + elseif os.execute("luac " .. command) == 0 then + return true + else + return false + end end @@ -1744,7 +1770,9 @@ end -- (any case), rest paths (so no need for optimization). Or maybe a -- separate table that matches lowercase names to mixed case when -- present. In that case the lower() cases can go away. I will do that --- only when we run into problems with names. +-- only when we run into problems with names ... well ... Iwona-Regular. + +-- Beware, loading and saving is overloaded in luat-tmp! if not versions then versions = { } end versions['luat-inp'] = 1.001 if not environment then environment = { } end @@ -1808,12 +1836,14 @@ input.suffixes['lua'] = { 'lua', 'luc', 'tma', 'tmc' } -- here we catch a few new thingies function input.checkconfigdata(instance) - if input.env(instance,"LUAINPUTS") == "" then - instance.environment["LUAINPUTS"] = ".;$TEXINPUTS;$TEXMFSCRIPTS" - end - if input.env(instance,"FONTFEATURES") == "" then - instance.environment["FONTFEATURES"] = ".;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS" + function fix(varname,default) + local proname = varname .. "." .. instance.progname or "crap" + if not instance.environment[proname] and not instance.variables[proname] == "" and not instance.environment[varname] and not instance.variables[varname] == "" then + instance.variables[varname] = default + end end + fix("LUAINPUTS" , ".;$TEXINPUTS;$TEXMFSCRIPTS") + fix("FONTFEATURES", ".;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS") end -- backward compatible ones @@ -1849,6 +1879,7 @@ function input.reset() instance.variables = { } instance.expansions = { } instance.files = { } + instance.remap = { } instance.configuration = { } instance.found = { } instance.foundintrees = { } @@ -1969,7 +2000,7 @@ function input.reportlines(str) for _,v in pairs(str) do input.report(v) end end -input.settrace(os.getenv("MTX.INPUT.TRACE") or os.getenv("MTX_INPUT_TRACE") or input.trace or 0) +input.settrace(tonumber(os.getenv("MTX.INPUT.TRACE") or os.getenv("MTX_INPUT_TRACE") or input.trace or 0)) -- These functions can be used to test the performance, especially -- loading the database files. @@ -2350,6 +2381,10 @@ function input.generators.tex(instance,specification) end else files[name] = path + local lower = name:lower() + if name ~= lower then + files["remap:"..lower] = name + end end end end @@ -2380,6 +2415,10 @@ function input.generators.tex(instance,specification) end else files[line] = path -- string + local lower = line:lower() + if line ~= lower then + files["remap:"..lower] = line + end end else path = line:match("%.%/(.-)%:$") or path -- match could be nil due to empty line @@ -2840,8 +2879,8 @@ function input.aux.expanded_path(instance,pathlist) local pre, mid, post = v:match(pattern) if pre and mid and post then more = true - -- for _,vv in ipairs(mid:splitchr(',')) do - for vv in string.gmatch(mid..',',"(.-),") do +--~ for vv in string.gmatch(mid..',',"(.-),") do + for vv in string.gmatch(mid,"([^,]+)") do if vv == '.' then t[#t+1] = pre..post else @@ -2915,11 +2954,20 @@ function input.aux.collect_files(instance,names) end for _, hash in pairs(instance.hashes) do local blobpath = hash.tag - if blobpath and instance.files[blobpath] then + local files = blobpath and instance.files[blobpath] + if files then if input.trace > 2 then input.logger('? blobpath do',blobpath .. " (" .. bname ..")") end - local blobfile = instance.files[blobpath][bname] + local blobfile = files[bname] + if not blobfile then + local rname = "remap:"..bname + blobfile = files[rname] + if blobfile then + bname = files[rname] + blobfile = files[bname] + end + end if blobfile then if type(blobfile) == 'string' then if not dname or blobfile:find(dname) then @@ -3547,14 +3595,16 @@ end -- beware: i need to check where we still need a / on windows: function input.clean_path(str) - -- return string.gsub(string.gsub(string.gsub(str,"\\","/"),"^!+",""),"//$","/") - return (string.gsub(string.gsub(str,"\\","/"),"^!+","")) +--~ return (((str:gsub("\\","/")):gsub("^!+","")):gsub("//+","//")) + return ((str:gsub("\\","/")):gsub("^!+","")) end + function input.do_with_path(name,func) for _, v in pairs(input.expanded_path_list(instance,name)) do func("^"..input.clean_path(v)) end end + function input.do_with_var(name,func) func(input.aux.expanded_var(name)) end @@ -3623,16 +3673,16 @@ cache = cache or { } dir = dir or { } texmf = texmf or { } -cache.path = nil +cache.path = cache.path or nil cache.base = cache.base or "luatex-cache" cache.more = cache.more or "context" cache.direct = false -- true is faster but may need huge amounts of memory cache.trace = false cache.tree = false -cache.temp = os.getenv("TEXMFCACHE") or os.getenv("HOME") or os.getenv("HOMEPATH") or os.getenv("VARTEXMF") or os.getenv("TEXMFVAR") or os.getenv("TMP") or os.getenv("TEMP") or os.getenv("TMPDIR") or nil -cache.paths = { cache.temp } +cache.temp = cache.temp or os.getenv("TEXMFCACHE") or os.getenv("HOME") or os.getenv("HOMEPATH") or os.getenv("VARTEXMF") or os.getenv("TEXMFVAR") or os.getenv("TMP") or os.getenv("TEMP") or os.getenv("TMPDIR") or nil +cache.paths = cache.paths or { cache.temp } -if not cache.temp then +if not cache.temp or cache.temp == "" then print("\nFATAL ERROR: NO VALID TEMPORARY PATH\n") os.exit() end @@ -3666,6 +3716,7 @@ function cache.setpath(instance,...) if not cache.path then cache.path = cache.temp end + cache.path = input.clean_path(cache.path) -- to be sure if lfs then cache.tree = cache.tree or cache.treehash(instance) if cache.tree then @@ -5021,6 +5072,7 @@ function input.my_make_format(instance,texname) end function input.my_run_format(instance,name,data) + -- hm, rather old code here; we can now use the file.whatever functions if name and (name ~= "") then local barename = name:gsub("%.%a+$","") local fmtname = "" @@ -5032,7 +5084,7 @@ function input.my_run_format(instance,name,data) fmtname = input.find_files(instance,barename..".fmt")[1] or "" end fmtname = input.clean_path(fmtname) - local barename = fmtname:gsub("%.%a+$","") + barename = fmtname:gsub("%.%a+$","") if fmtname == "" then input.report("no format with name",name) else diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua new file mode 100644 index 000000000..864fd2267 --- /dev/null +++ b/scripts/context/lua/mtx-context.lua @@ -0,0 +1,223 @@ +dofile(input.find_file(instance,"luat-log.lua")) + +texmf.instance = instance -- we need to get rid of this / maybe current instance in global table + +scripts = scripts or { } +scripts.context = scripts.context or { } + +function io.copydata(fromfile,tofile) + io.savedata(tofile,io.loaddata(fromfile) or "") +end + +function input.locate_format(name) -- move this to core / luat-xxx + local barename, fmtname = name:gsub("%.%a+$",""), "" + if input.usecache then + local path = file.join(cache.setpath(instance,"formats")) -- maybe platform + fmtname = file.join(path,barename..".fmt") or "" + end + if fmtname == "" then + fmtname = input.find_files(instance,barename..".fmt")[1] or "" + end + fmtname = input.clean_path(fmtname) + if fmtname ~= "" then + barename = fmtname:gsub("%.%a+$","") + local luaname, lucname = barename .. ".lua", barename .. ".luc" + if io.exists(lucname) then + return barename, luaname + elseif io.exists(luaname) then + return barename, luaname + end + end + return nil, nil +end + +scripts.context.multipass = { + suffixes = { ".tuo", ".tuc" }, + nofruns = 8, +} + +function scripts.context.multipass.hashfiles(jobname) + local hash = { } + for _, suffix in ipairs(scripts.context.multipass.suffixes) do + local full = jobname .. suffix + hash[full] = md5.hex(io.loaddata(full) or "unknown") + end + return hash +end + +function scripts.context.multipass.changed(oldhash, newhash) + for k,v in pairs(oldhash) do + if v ~= newhash[k] then + return true + end + end + return false +end + +scripts.context.backends = { + pdftex = 'pdftex', + luatex = 'pdftex', + pdf = 'pdftex', + dvi = 'dvipdfmx', + dvips = 'dvips' +} + +function scripts.context.multipass.makeoptionfile(jobname) + local f = io.open(jobname..".top","w") + if f then + local finalrun, kindofrun, currentrun = false, 0, 0 + local function setvalue(flag,format,hash,default) + local a = environment.argument(flag) + a = a or default + if a and a ~= "" then + if hash then + if hash[a] then + f:write(format:format(a),"\n") + end + else + f:write(format:format(a),"\n") + end + end + end + local function setvalues(flag,format) + local a = environment.argument(flag) + if a and a ~= "" then + for _, v in a:gmatch("([^,]+)") do + f:write(format:format(v),"\n") + end + end + end + local function setfixed(flag,format,...) + if environment.argument(flag) then + f:write(format:format(...),"\n") + end + end + local function setalways(format,...) + f:write(format:format(...),"\n") + end + setalways("\\unprotect") + setvalue('output' , "\\setupoutput[%s]", scripts.context.backends, 'pdftex') + setalways( "\\setupsystem[\\c!n=%s,\\c!m=%s]", kindofrun, currentrun) + setalways( "\\setupsystem[\\c!type=%s]",os.platform) + setfixed ("batchmode" , "\\batchmode") + setfixed ("nonstopmode", "\\nonstopmode") + setfixed ("paranoid" , "\\def\\maxreadlevel{1}") + setvalue ("modefile" , "\\readlocfile{%s}{}{}") + setvalue ("result" , "\\setupsystem[file=%s]") + setvalue("path" , "\\usepath[%s]") + setfixed("color" , "\\setupcolors[\\c!state=\\v!start]") + setfixed("nompmode" , "\\runMPgraphicsfalse") -- obsolete, we assume runtime mp graphics + setfixed("nomprun" , "\\runMPgraphicsfalse") -- obsolete, we assume runtime mp graphics + setfixed("automprun" , "\\runMPgraphicsfalse") -- obsolete, we assume runtime mp graphics + setfixed("fast" , "\\fastmode\n") + setfixed("silentmode" , "\\silentmode\n") + setvalue("separation" , "\\setupcolors[\\c!split=%s]") + setvalue("setuppath" , "\\setupsystem[\\c!directory={%s}]") + setfixed("noarrange" , "\\setuparranging[\\v!disable]") + if environment.argument('arrange') and not finalrun then + setalways( "\\setuparranging[\\v!disable]") + end + setvalue("modes" , "\\enablemode[%s]") + setvalue("mode" , "\\enablemode[%s]") + setvalue("arguments" , "\\setupenv[%s]") + setvalue("randomseed" , "\\setupsystem[\\c!random=%s]") + setvalue("filters" , "\\useXMLfilter[%s]") + setvalue("usemodules" , "\\usemodule[%s]") + setvalue("environments", "\\environment %s ") + setalways( "\\protect") + setalways( "\\endinput") + f:close() + end +end + +function scripts.context.multipass.copyluafile(jobname) + io.savedata(jobname..".tuc",io.loaddata(jobname..".tua") or "") +end + +function scripts.context.multipass.copytuifile(jobname) + local f, g = io.open(jobname..".tui"), io.open(jobname..".tuo",'w') + if f and g then + g:write("% traditional utility file, only commands written by mtxrun/context\n%\n") + for line in f:lines() do + if line:find("^c ") then + g:write((line:gsub("^c ","")),"\n") + end + end + f:close() + g:close() + end +end + +function scripts.context.run() + -- todo: interface + local files = environment.files + if #files > 0 then + input.identify_cnf(instance) + input.load_cnf(instance) + input.expand_variables(instance) + local formatname = "cont-en" + local formatfile, scriptfile = input.locate_format(formatname) + if formatfile and scriptfile then + for _, filename in ipairs(files) do + local basename, pathname = file.basename(filename), file.dirname(filename) + local jobname = file.removesuffix(basename) + if pathname ~= "" and pathname ~= "." then + filename = "./" .. filename + end + local command = "luatex --fmt=" .. string.quote(formatfile) .. " --lua=" .. string.quote(scriptfile) .. " " .. string.quote(filename) + local oldhash, newhash = scripts.context.multipass.hashfiles(jobname), { } + scripts.context.multipass.makeoptionfile(jobname) + for i=1, scripts.context.multipass.nofruns do + input.report(string.format("run %s: %s",i,command)) + local returncode = os.execute(command) + input.report("return code: " .. returncode) + if returncode > 0 then + input.reportr("fatal error, run aborted") + break + else + scripts.context.multipass.copyluafile(jobname) + scripts.context.multipass.copytuifile(jobname) + newhash = scripts.context.multipass.hashfiles(jobname) + if scripts.context.multipass.changed(oldhash,newhash) then + oldhash = newhash + else + break + end + end + end + end + else + input.error("no format found with name " .. formatname) + end + end +end + +function scripts.context.make() + -- hack, should also be a shared function + for _, name in ipairs( { "cont-en", "cont-nl", "mptopdf" } ) do + local command = "luatools --make --compile " .. name + input.report("running command: " .. command) + os.execute(command) + end +end + +banner = banner .. " | context tools " + +messages.help = [[ +--run process (one or more) files +--make generate formats +]] + +input.verbose = true +input.start_timing(scripts.context) + +if environment.argument("run") then + scripts.context.run() +elseif environment.argument("make") then + scripts.context.make() +else + input.help(banner,messages.help) +end + +input.stop_timing(scripts.context) +input.report("total runtime: " .. input.elapsedtime(scripts.context)) diff --git a/scripts/context/lua/mtx-fonts.lua b/scripts/context/lua/mtx-fonts.lua index 10211fe22..ba5215ab1 100644 --- a/scripts/context/lua/mtx-fonts.lua +++ b/scripts/context/lua/mtx-fonts.lua @@ -6,6 +6,10 @@ texmf.instance = instance -- we need to get rid of this / maybe current instance scripts = scripts or { } scripts.fonts = scripts.fonts or { } +function scripts.fonts.reload() + fonts.names.load(true) +end + function scripts.fonts.list(pattern,reload,all) if reload then logs.report("fontnames","reloading font database") @@ -68,15 +72,17 @@ end banner = banner .. " | font tools " messages.help = [[ +--reload generate new font database --list list installed fonts --save save open type font in raw table --pattern=str filter files ---reload generate new font database --all provide alternatives ]] -if environment.argument("list") then +if environment.argument("reload") then + scripts.fonts.reload() +elseif environment.argument("list") then local pattern = environment.argument("pattern") or environment.files[1] or "" local all = environment.argument("all") local reload = environment.argument("reload") diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index d5a0701c9..caaca8d30 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -1111,8 +1111,12 @@ function file.extname(name) return name:match("^.+%.(.-)$") or "" end -function file.join(...) -- args - return (string.gsub(table.concat({...},"/"),"\\","/")) +function file.join(...) + local t = { ... } + for i=1,#t do + t[i] = (t[i]:gsub("\\","/")):gsub("/+$","") + end + return table.concat(t,"/") end function file.is_writable(name) @@ -1135,16 +1139,31 @@ function file.is_readable(name) end end +--~ function file.split_path(str) +--~ if str:find(';') then +--~ return str:splitchr(";") +--~ else +--~ return str:splitchr(io.pathseparator) +--~ end +--~ end + +-- todo: lpeg + function file.split_path(str) - if str:find(';') then - return str:splitchr(";") - else - return str:splitchr(io.pathseparator) + local t = { } + str = str:gsub("\\", "/") + str = str:gsub("(%a):([;/])", "%1\001%2") + for name in str:gmatch("([^;:]+)") do + if name ~= "" then + name = name:gsub("\001",":") + t[#t+1] = name + end end + return t end function file.join_path(tab) - return table.concat(tab,io.pathseparator) + return table.concat(tab,io.pathseparator) -- can have trailing // end --~ print('test' .. " == " .. file.collapse_path("test")) @@ -1433,7 +1452,14 @@ end function utils.lua.compile(luafile, lucfile) -- utils.report("compiling",luafile,"into",lucfile) os.remove(lucfile) - return (os.execute("luac -s -o " .. string.quote(lucfile) .. " " .. string.quote(luafile)) == 0) + local command = "-s -o " .. string.quote(lucfile) .. " " .. string.quote(luafile) + if os.execute("texluac " .. command) == 0 then + return true + elseif os.execute("luac " .. command) == 0 then + return true + else + return false + end end @@ -1600,7 +1626,9 @@ end -- (any case), rest paths (so no need for optimization). Or maybe a -- separate table that matches lowercase names to mixed case when -- present. In that case the lower() cases can go away. I will do that --- only when we run into problems with names. +-- only when we run into problems with names ... well ... Iwona-Regular. + +-- Beware, loading and saving is overloaded in luat-tmp! if not versions then versions = { } end versions['luat-inp'] = 1.001 if not environment then environment = { } end @@ -1664,12 +1692,14 @@ input.suffixes['lua'] = { 'lua', 'luc', 'tma', 'tmc' } -- here we catch a few new thingies function input.checkconfigdata(instance) - if input.env(instance,"LUAINPUTS") == "" then - instance.environment["LUAINPUTS"] = ".;$TEXINPUTS;$TEXMFSCRIPTS" - end - if input.env(instance,"FONTFEATURES") == "" then - instance.environment["FONTFEATURES"] = ".;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS" + function fix(varname,default) + local proname = varname .. "." .. instance.progname or "crap" + if not instance.environment[proname] and not instance.variables[proname] == "" and not instance.environment[varname] and not instance.variables[varname] == "" then + instance.variables[varname] = default + end end + fix("LUAINPUTS" , ".;$TEXINPUTS;$TEXMFSCRIPTS") + fix("FONTFEATURES", ".;$OPENTYPEFONTS;$TTFONTS;$T1FONTS;$AFMFONTS") end -- backward compatible ones @@ -1705,6 +1735,7 @@ function input.reset() instance.variables = { } instance.expansions = { } instance.files = { } + instance.remap = { } instance.configuration = { } instance.found = { } instance.foundintrees = { } @@ -1825,7 +1856,7 @@ function input.reportlines(str) for _,v in pairs(str) do input.report(v) end end -input.settrace(os.getenv("MTX.INPUT.TRACE") or os.getenv("MTX_INPUT_TRACE") or input.trace or 0) +input.settrace(tonumber(os.getenv("MTX.INPUT.TRACE") or os.getenv("MTX_INPUT_TRACE") or input.trace or 0)) -- These functions can be used to test the performance, especially -- loading the database files. @@ -2206,6 +2237,10 @@ function input.generators.tex(instance,specification) end else files[name] = path + local lower = name:lower() + if name ~= lower then + files["remap:"..lower] = name + end end end end @@ -2236,6 +2271,10 @@ function input.generators.tex(instance,specification) end else files[line] = path -- string + local lower = line:lower() + if line ~= lower then + files["remap:"..lower] = line + end end else path = line:match("%.%/(.-)%:$") or path -- match could be nil due to empty line @@ -2696,8 +2735,8 @@ function input.aux.expanded_path(instance,pathlist) local pre, mid, post = v:match(pattern) if pre and mid and post then more = true - -- for _,vv in ipairs(mid:splitchr(',')) do - for vv in string.gmatch(mid..',',"(.-),") do +--~ for vv in string.gmatch(mid..',',"(.-),") do + for vv in string.gmatch(mid,"([^,]+)") do if vv == '.' then t[#t+1] = pre..post else @@ -2771,11 +2810,20 @@ function input.aux.collect_files(instance,names) end for _, hash in pairs(instance.hashes) do local blobpath = hash.tag - if blobpath and instance.files[blobpath] then + local files = blobpath and instance.files[blobpath] + if files then if input.trace > 2 then input.logger('? blobpath do',blobpath .. " (" .. bname ..")") end - local blobfile = instance.files[blobpath][bname] + local blobfile = files[bname] + if not blobfile then + local rname = "remap:"..bname + blobfile = files[rname] + if blobfile then + bname = files[rname] + blobfile = files[bname] + end + end if blobfile then if type(blobfile) == 'string' then if not dname or blobfile:find(dname) then @@ -3403,14 +3451,16 @@ end -- beware: i need to check where we still need a / on windows: function input.clean_path(str) - -- return string.gsub(string.gsub(string.gsub(str,"\\","/"),"^!+",""),"//$","/") - return (string.gsub(string.gsub(str,"\\","/"),"^!+","")) +--~ return (((str:gsub("\\","/")):gsub("^!+","")):gsub("//+","//")) + return ((str:gsub("\\","/")):gsub("^!+","")) end + function input.do_with_path(name,func) for _, v in pairs(input.expanded_path_list(instance,name)) do func("^"..input.clean_path(v)) end end + function input.do_with_var(name,func) func(input.aux.expanded_var(name)) end @@ -3479,16 +3529,16 @@ cache = cache or { } dir = dir or { } texmf = texmf or { } -cache.path = nil +cache.path = cache.path or nil cache.base = cache.base or "luatex-cache" cache.more = cache.more or "context" cache.direct = false -- true is faster but may need huge amounts of memory cache.trace = false cache.tree = false -cache.temp = os.getenv("TEXMFCACHE") or os.getenv("HOME") or os.getenv("HOMEPATH") or os.getenv("VARTEXMF") or os.getenv("TEXMFVAR") or os.getenv("TMP") or os.getenv("TEMP") or os.getenv("TMPDIR") or nil -cache.paths = { cache.temp } +cache.temp = cache.temp or os.getenv("TEXMFCACHE") or os.getenv("HOME") or os.getenv("HOMEPATH") or os.getenv("VARTEXMF") or os.getenv("TEXMFVAR") or os.getenv("TMP") or os.getenv("TEMP") or os.getenv("TMPDIR") or nil +cache.paths = cache.paths or { cache.temp } -if not cache.temp then +if not cache.temp or cache.temp == "" then print("\nFATAL ERROR: NO VALID TEMPORARY PATH\n") os.exit() end @@ -3522,6 +3572,7 @@ function cache.setpath(instance,...) if not cache.path then cache.path = cache.temp end + cache.path = input.clean_path(cache.path) -- to be sure if lfs then cache.tree = cache.tree or cache.treehash(instance) if cache.tree then @@ -4557,7 +4608,7 @@ elseif environment.argument("selfclean") then -- remove embedded libraries utils.merger.selfclean(own.name) elseif environment.arguments["selfupdate"] then - input.my_prepare_b(instance) + input.runners.my_prepare_b(instance) input.verbose = true input.update_script(own.name,"mtxrun") elseif environment.argument("ctxlua") or environment.argument("internal") then diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb index 724f5593f..598bfac20 100644 --- a/scripts/context/ruby/ctxtools.rb +++ b/scripts/context/ruby/ctxtools.rb @@ -2653,13 +2653,14 @@ class Commands end def remakeformats - return system("mktexlsr") - return system("luatools --selfupdate") - return system("mtxrun --selfupdate") - return system("luatools --generate") - return system("texmfstart texexec --make --all --fast --pdftex") - return system("texmfstart texexec --make --all --fast --luatex") - return system("texmfstart texexec --make --all --fast --xetex") + system("mktexlsr") + system("luatools --selfupdate") + system("mtxrun --selfupdate") + system("luatools --generate") + system("texmfstart texexec --make --all --fast --pdftex") + system("texmfstart texexec --make --all --fast --luatex") + system("texmfstart texexec --make --all --fast --xetex") + return true end if localtree = locatedlocaltree then |