From 1e6ba021602441d20ced70966de1037d7ce186ee Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 1 Feb 2011 15:40:12 +0200 Subject: beta 2011.02.01 14:24 --- scripts/context/lua/mtxrun.lua | 58 ++++++++++++++-------------- scripts/context/stubs/mswin/mtxrun.lua | 58 ++++++++++++++-------------- scripts/context/stubs/unix/mtxrun | 58 ++++++++++++++-------------- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/core-con.lua | 2 +- tex/context/base/data-res.lua | 45 ++++++++++----------- tex/context/base/l-dir.lua | 28 +++++++------- tex/context/base/s-inf-01.mkvi | 2 +- tex/context/base/status-files.pdf | Bin 23919 -> 8943 bytes tex/generic/context/luatex-fonts-merged.lua | 2 +- 13 files changed, 133 insertions(+), 128 deletions(-) diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 20d0a3b08..0251ed5ed 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -2937,20 +2937,22 @@ end local function globpattern(path,patt,recurse,action) - if path == "/" then - path = path .. "." - elseif not find(path,"/$") then - path = path .. '/' - end - for name in walkdir(path) do - local full = path .. name - local mode = attributes(full,'mode') - if mode == 'file' then - if find(full,patt) then - action(full) + if isdir(path) then + if path == "/" then + path = path .. "." + elseif not find(path,"/$") then + path = path .. '/' + end + for name in walkdir(path) do + local full = path .. name + local mode = attributes(full,'mode') + if mode == 'file' then + if find(full,patt) then + action(full) + end + elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then + globpattern(full,patt,recurse,action) end - elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then - globpattern(full,patt,recurse,action) end end end @@ -10631,6 +10633,7 @@ resolvers.luacnfstate = "unknown" resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c},}}' + local unset_variable = "unset" local formats = resolvers.formats @@ -10716,7 +10719,6 @@ end resolvers.getenv = getenv resolvers.env = getenv - local dollarstripper = lpeg.stripper("$") local inhibitstripper = P("!")^0 * Cs(P(1)^0) local backslashswapper = lpeg.replacer("\\","/") @@ -10907,7 +10909,7 @@ local function load_configuration_files() -- we push the value into the main environment (osenv) so -- that it takes precedence over the default one and therefore -- also over following definitions - resolvers.setenv('TEXMFCNF',cnfspec) + resolvers.setenv('TEXMFCNF',resolvers.resolve(cnfspec)) -- we now identify and load the specified configuration files instance.specification = { } identify_configuration_files() @@ -11390,7 +11392,8 @@ local function collect_files(names) if type(blobfile) == 'string' then if not dname or find(blobfile,dname) then local kind = hash.type -local search = filejoin(blobroot,blobfile,bname) + -- local search = filejoin(blobpath,blobfile,bname) + local search = filejoin(blobroot,blobfile,bname) local result = methodhandler('concatinators',hash.type,blobroot,blobfile,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -11403,7 +11406,8 @@ local search = filejoin(blobroot,blobfile,bname) local vv = blobfile[kk] if not dname or find(vv,dname) then local kind = hash.type -local search = filejoin(blobroot,vv,bname) + -- local search = filejoin(blobpath,vv,bname) + local search = filejoin(blobroot,vv,bname) local result = methodhandler('concatinators',hash.type,blobroot,vv,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -11428,7 +11432,7 @@ function resolvers.registerintrees(name) end end --- split the next one up for readability (bu this module needs a cleanup anyway) +-- split the next one up for readability (but this module needs a cleanup anyway) local function can_be_dir(name) -- can become local local fakepaths = instance.fakepaths @@ -11444,6 +11448,8 @@ end local preparetreepattern = Cs((P(".")/"%%." + P("-")/"%%-" + P(1))^0 * Cc("$")) +-- this one will be split in smalle functions + local function collect_instance_files(filename,askedformat,allresults) -- todo : plugin (scanners, checkers etc) local result = { } local stamp = nil @@ -11454,7 +11460,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : stamp = filename .. "--" .. instance.engine .. "--" .. instance.progname .. "--" .. askedformat if instance.found[stamp] then if trace_locating then - report_resolvers("remembering file '%s'",filename) + report_resolvers("remembered file '%s'",filename) end resolvers.registerintrees(filename) -- for tracing used files return instance.found[stamp] @@ -11517,7 +11523,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : -- if basename ~= filename then local resolved = collect_instance_files(basename,askedformat,allresults) - if #result == 0 then + if #result == 0 then -- shouldn't this be resolved ? local lowered = lower(basename) if filename ~= lowered then resolved = collect_instance_files(lowered,askedformat,allresults) @@ -11550,16 +11556,12 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : end else -- search spec - local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename) + local filetype, done, wantedfiles, ext = '', false, { }, fileextname(filename) -- tricky as filename can be bla.1.2.3 -- to be checked - if ext == "" then - wantedfiles[#wantedfiles+1] = filename - else - wantedfiles[#wantedfiles+1] = filename - end + wantedfiles[#wantedfiles+1] = filename if askedformat == "" then if ext == "" or not suffixmap[ext] then local defaultsuffixes = resolvers.defaultsuffixes @@ -11865,7 +11867,7 @@ local function report(str) end end -function resolvers.dowithfilesandreport(command, files, ...) +function resolvers.dowithfilesandreport(command, files, ...) -- will move if files and #files > 0 then if trace_locating then report('') -- ? @@ -11947,7 +11949,7 @@ function resolvers.booleanvariable(str,default) end end -function resolvers.dowithfilesintree(pattern,handle,before,after) -- can be a nice iterator instead +function resolvers.dowithfilesintree(pattern,handle,before,after) -- will move, can be a nice iterator instead local instance = resolvers.instance local hashes = instance.hashes for i=1,#hashes do diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 20d0a3b08..0251ed5ed 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -2937,20 +2937,22 @@ end local function globpattern(path,patt,recurse,action) - if path == "/" then - path = path .. "." - elseif not find(path,"/$") then - path = path .. '/' - end - for name in walkdir(path) do - local full = path .. name - local mode = attributes(full,'mode') - if mode == 'file' then - if find(full,patt) then - action(full) + if isdir(path) then + if path == "/" then + path = path .. "." + elseif not find(path,"/$") then + path = path .. '/' + end + for name in walkdir(path) do + local full = path .. name + local mode = attributes(full,'mode') + if mode == 'file' then + if find(full,patt) then + action(full) + end + elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then + globpattern(full,patt,recurse,action) end - elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then - globpattern(full,patt,recurse,action) end end end @@ -10631,6 +10633,7 @@ resolvers.luacnfstate = "unknown" resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c},}}' + local unset_variable = "unset" local formats = resolvers.formats @@ -10716,7 +10719,6 @@ end resolvers.getenv = getenv resolvers.env = getenv - local dollarstripper = lpeg.stripper("$") local inhibitstripper = P("!")^0 * Cs(P(1)^0) local backslashswapper = lpeg.replacer("\\","/") @@ -10907,7 +10909,7 @@ local function load_configuration_files() -- we push the value into the main environment (osenv) so -- that it takes precedence over the default one and therefore -- also over following definitions - resolvers.setenv('TEXMFCNF',cnfspec) + resolvers.setenv('TEXMFCNF',resolvers.resolve(cnfspec)) -- we now identify and load the specified configuration files instance.specification = { } identify_configuration_files() @@ -11390,7 +11392,8 @@ local function collect_files(names) if type(blobfile) == 'string' then if not dname or find(blobfile,dname) then local kind = hash.type -local search = filejoin(blobroot,blobfile,bname) + -- local search = filejoin(blobpath,blobfile,bname) + local search = filejoin(blobroot,blobfile,bname) local result = methodhandler('concatinators',hash.type,blobroot,blobfile,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -11403,7 +11406,8 @@ local search = filejoin(blobroot,blobfile,bname) local vv = blobfile[kk] if not dname or find(vv,dname) then local kind = hash.type -local search = filejoin(blobroot,vv,bname) + -- local search = filejoin(blobpath,vv,bname) + local search = filejoin(blobroot,vv,bname) local result = methodhandler('concatinators',hash.type,blobroot,vv,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -11428,7 +11432,7 @@ function resolvers.registerintrees(name) end end --- split the next one up for readability (bu this module needs a cleanup anyway) +-- split the next one up for readability (but this module needs a cleanup anyway) local function can_be_dir(name) -- can become local local fakepaths = instance.fakepaths @@ -11444,6 +11448,8 @@ end local preparetreepattern = Cs((P(".")/"%%." + P("-")/"%%-" + P(1))^0 * Cc("$")) +-- this one will be split in smalle functions + local function collect_instance_files(filename,askedformat,allresults) -- todo : plugin (scanners, checkers etc) local result = { } local stamp = nil @@ -11454,7 +11460,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : stamp = filename .. "--" .. instance.engine .. "--" .. instance.progname .. "--" .. askedformat if instance.found[stamp] then if trace_locating then - report_resolvers("remembering file '%s'",filename) + report_resolvers("remembered file '%s'",filename) end resolvers.registerintrees(filename) -- for tracing used files return instance.found[stamp] @@ -11517,7 +11523,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : -- if basename ~= filename then local resolved = collect_instance_files(basename,askedformat,allresults) - if #result == 0 then + if #result == 0 then -- shouldn't this be resolved ? local lowered = lower(basename) if filename ~= lowered then resolved = collect_instance_files(lowered,askedformat,allresults) @@ -11550,16 +11556,12 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : end else -- search spec - local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename) + local filetype, done, wantedfiles, ext = '', false, { }, fileextname(filename) -- tricky as filename can be bla.1.2.3 -- to be checked - if ext == "" then - wantedfiles[#wantedfiles+1] = filename - else - wantedfiles[#wantedfiles+1] = filename - end + wantedfiles[#wantedfiles+1] = filename if askedformat == "" then if ext == "" or not suffixmap[ext] then local defaultsuffixes = resolvers.defaultsuffixes @@ -11865,7 +11867,7 @@ local function report(str) end end -function resolvers.dowithfilesandreport(command, files, ...) +function resolvers.dowithfilesandreport(command, files, ...) -- will move if files and #files > 0 then if trace_locating then report('') -- ? @@ -11947,7 +11949,7 @@ function resolvers.booleanvariable(str,default) end end -function resolvers.dowithfilesintree(pattern,handle,before,after) -- can be a nice iterator instead +function resolvers.dowithfilesintree(pattern,handle,before,after) -- will move, can be a nice iterator instead local instance = resolvers.instance local hashes = instance.hashes for i=1,#hashes do diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 20d0a3b08..0251ed5ed 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -2937,20 +2937,22 @@ end local function globpattern(path,patt,recurse,action) - if path == "/" then - path = path .. "." - elseif not find(path,"/$") then - path = path .. '/' - end - for name in walkdir(path) do - local full = path .. name - local mode = attributes(full,'mode') - if mode == 'file' then - if find(full,patt) then - action(full) + if isdir(path) then + if path == "/" then + path = path .. "." + elseif not find(path,"/$") then + path = path .. '/' + end + for name in walkdir(path) do + local full = path .. name + local mode = attributes(full,'mode') + if mode == 'file' then + if find(full,patt) then + action(full) + end + elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then + globpattern(full,patt,recurse,action) end - elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then - globpattern(full,patt,recurse,action) end end end @@ -10631,6 +10633,7 @@ resolvers.luacnfstate = "unknown" resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c},}}' + local unset_variable = "unset" local formats = resolvers.formats @@ -10716,7 +10719,6 @@ end resolvers.getenv = getenv resolvers.env = getenv - local dollarstripper = lpeg.stripper("$") local inhibitstripper = P("!")^0 * Cs(P(1)^0) local backslashswapper = lpeg.replacer("\\","/") @@ -10907,7 +10909,7 @@ local function load_configuration_files() -- we push the value into the main environment (osenv) so -- that it takes precedence over the default one and therefore -- also over following definitions - resolvers.setenv('TEXMFCNF',cnfspec) + resolvers.setenv('TEXMFCNF',resolvers.resolve(cnfspec)) -- we now identify and load the specified configuration files instance.specification = { } identify_configuration_files() @@ -11390,7 +11392,8 @@ local function collect_files(names) if type(blobfile) == 'string' then if not dname or find(blobfile,dname) then local kind = hash.type -local search = filejoin(blobroot,blobfile,bname) + -- local search = filejoin(blobpath,blobfile,bname) + local search = filejoin(blobroot,blobfile,bname) local result = methodhandler('concatinators',hash.type,blobroot,blobfile,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -11403,7 +11406,8 @@ local search = filejoin(blobroot,blobfile,bname) local vv = blobfile[kk] if not dname or find(vv,dname) then local kind = hash.type -local search = filejoin(blobroot,vv,bname) + -- local search = filejoin(blobpath,vv,bname) + local search = filejoin(blobroot,vv,bname) local result = methodhandler('concatinators',hash.type,blobroot,vv,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -11428,7 +11432,7 @@ function resolvers.registerintrees(name) end end --- split the next one up for readability (bu this module needs a cleanup anyway) +-- split the next one up for readability (but this module needs a cleanup anyway) local function can_be_dir(name) -- can become local local fakepaths = instance.fakepaths @@ -11444,6 +11448,8 @@ end local preparetreepattern = Cs((P(".")/"%%." + P("-")/"%%-" + P(1))^0 * Cc("$")) +-- this one will be split in smalle functions + local function collect_instance_files(filename,askedformat,allresults) -- todo : plugin (scanners, checkers etc) local result = { } local stamp = nil @@ -11454,7 +11460,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : stamp = filename .. "--" .. instance.engine .. "--" .. instance.progname .. "--" .. askedformat if instance.found[stamp] then if trace_locating then - report_resolvers("remembering file '%s'",filename) + report_resolvers("remembered file '%s'",filename) end resolvers.registerintrees(filename) -- for tracing used files return instance.found[stamp] @@ -11517,7 +11523,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : -- if basename ~= filename then local resolved = collect_instance_files(basename,askedformat,allresults) - if #result == 0 then + if #result == 0 then -- shouldn't this be resolved ? local lowered = lower(basename) if filename ~= lowered then resolved = collect_instance_files(lowered,askedformat,allresults) @@ -11550,16 +11556,12 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : end else -- search spec - local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename) + local filetype, done, wantedfiles, ext = '', false, { }, fileextname(filename) -- tricky as filename can be bla.1.2.3 -- to be checked - if ext == "" then - wantedfiles[#wantedfiles+1] = filename - else - wantedfiles[#wantedfiles+1] = filename - end + wantedfiles[#wantedfiles+1] = filename if askedformat == "" then if ext == "" or not suffixmap[ext] then local defaultsuffixes = resolvers.defaultsuffixes @@ -11865,7 +11867,7 @@ local function report(str) end end -function resolvers.dowithfilesandreport(command, files, ...) +function resolvers.dowithfilesandreport(command, files, ...) -- will move if files and #files > 0 then if trace_locating then report('') -- ? @@ -11947,7 +11949,7 @@ function resolvers.booleanvariable(str,default) end end -function resolvers.dowithfilesintree(pattern,handle,before,after) -- can be a nice iterator instead +function resolvers.dowithfilesintree(pattern,handle,before,after) -- will move, can be a nice iterator instead local instance = resolvers.instance local hashes = instance.hashes for i=1,#hashes do diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 13cc7161a..953f94d71 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.01.31 22:31} +\newcontextversion{2011.02.01 14:24} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 3f65dd8c2..b87d196b2 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.01.31 22:31} +\newcontextversion{2011.02.01 14:24} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 5be64beb1..57db2f134 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.01.31 22:31} +\edef\contextversion{2011.02.01 14:24} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 42c33631f..76f7d070c 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.01.31 22:31} +\edef\contextversion{2011.02.01 14:24} %D For those who want to use this: diff --git a/tex/context/base/core-con.lua b/tex/context/base/core-con.lua index 318616db4..f6dfad9c9 100644 --- a/tex/context/base/core-con.lua +++ b/tex/context/base/core-con.lua @@ -548,7 +548,7 @@ local function convert(method,n) -- todo: language elseif sequence then return do_alphabetic(n,sequence,false,true) else - return context(n) + return n end end end diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua index 4231997ab..679135c48 100644 --- a/tex/context/base/data-res.lua +++ b/tex/context/base/data-res.lua @@ -53,6 +53,8 @@ resolvers.luacnfstate = "unknown" -- resolvers.luacnfspec = '{$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c}' -- what a rubish path resolvers.luacnfspec = 'selfautoparent:{/texmf{-local,}{,/web2c},}}' +--~ -- not yet, some reporters expect strings + --~ resolvers.luacnfspec = { --~ "selfautoparent:/texmf-local", --~ "selfautoparent:/texmf-local/web2c", @@ -146,12 +148,6 @@ end resolvers.getenv = getenv resolvers.env = getenv ---~ local function resolve(key) ---~ local value = instance.variables[key] or "" ---~ return (value ~= "" and value) or getenv(key) or "" ---~ end ---~ - local dollarstripper = lpeg.stripper("$") local inhibitstripper = P("!")^0 * Cs(P(1)^0) local backslashswapper = lpeg.replacer("\\","/") @@ -162,6 +158,11 @@ local somethingelse = P(";") * ((1-S("!{}/\\"))^1 * P(";") / "") + P(";") * (P(";") / "") + P(1) +--~ local function resolve(key) +--~ local value = instance.variables[key] or "" +--~ return (value ~= "" and value) or getenv(key) or "" +--~ end +--~ --~ local pattern = Cs( (somevariable * (somekey/resolve) + somethingelse)^1 ) --~ --~ local function expandvars(lst) -- simple vars @@ -350,7 +351,7 @@ local function load_configuration_files() -- we push the value into the main environment (osenv) so -- that it takes precedence over the default one and therefore -- also over following definitions - resolvers.setenv('TEXMFCNF',cnfspec) + resolvers.setenv('TEXMFCNF',resolvers.resolve(cnfspec)) -- we now identify and load the specified configuration files instance.specification = { } identify_configuration_files() @@ -855,8 +856,8 @@ local function collect_files(names) if type(blobfile) == 'string' then if not dname or find(blobfile,dname) then local kind = hash.type ---~ local search = filejoin(blobpath,blobfile,bname) -local search = filejoin(blobroot,blobfile,bname) + -- local search = filejoin(blobpath,blobfile,bname) + local search = filejoin(blobroot,blobfile,bname) local result = methodhandler('concatinators',hash.type,blobroot,blobfile,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -869,8 +870,8 @@ local search = filejoin(blobroot,blobfile,bname) local vv = blobfile[kk] if not dname or find(vv,dname) then local kind = hash.type ---~ local search = filejoin(blobpath,vv,bname) -local search = filejoin(blobroot,vv,bname) + -- local search = filejoin(blobpath,vv,bname) + local search = filejoin(blobroot,vv,bname) local result = methodhandler('concatinators',hash.type,blobroot,vv,bname) if trace_detail then report_resolvers("match: kind '%s', search '%s', result '%s'",kind,search,result) @@ -895,7 +896,7 @@ function resolvers.registerintrees(name) end end --- split the next one up for readability (bu this module needs a cleanup anyway) +-- split the next one up for readability (but this module needs a cleanup anyway) local function can_be_dir(name) -- can become local local fakepaths = instance.fakepaths @@ -911,11 +912,11 @@ end local preparetreepattern = Cs((P(".")/"%%." + P("-")/"%%-" + P(1))^0 * Cc("$")) +-- this one will be split in smalle functions + local function collect_instance_files(filename,askedformat,allresults) -- todo : plugin (scanners, checkers etc) local result = { } local stamp = nil ---~ local trace_locating = true ---~ local trace_detail= true askedformat = askedformat or "" filename = collapsepath(filename) -- speed up / beware: format problem @@ -923,7 +924,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : stamp = filename .. "--" .. instance.engine .. "--" .. instance.progname .. "--" .. askedformat if instance.found[stamp] then if trace_locating then - report_resolvers("remembering file '%s'",filename) + report_resolvers("remembered file '%s'",filename) end resolvers.registerintrees(filename) -- for tracing used files return instance.found[stamp] @@ -986,7 +987,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : -- if basename ~= filename then local resolved = collect_instance_files(basename,askedformat,allresults) - if #result == 0 then + if #result == 0 then -- shouldn't this be resolved ? local lowered = lower(basename) if filename ~= lowered then resolved = collect_instance_files(lowered,askedformat,allresults) @@ -1019,7 +1020,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : end else -- search spec - local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename) + local filetype, done, wantedfiles, ext = '', false, { }, fileextname(filename) -- tricky as filename can be bla.1.2.3 --~ if not suffixmap[ext] then --- probably needs to be done elsewhere too --~ wantedfiles[#wantedfiles+1] = filename @@ -1027,11 +1028,7 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : -- to be checked - if ext == "" then - wantedfiles[#wantedfiles+1] = filename - else - wantedfiles[#wantedfiles+1] = filename - end + wantedfiles[#wantedfiles+1] = filename if askedformat == "" then if ext == "" or not suffixmap[ext] then local defaultsuffixes = resolvers.defaultsuffixes @@ -1337,7 +1334,7 @@ local function report(str) end end -function resolvers.dowithfilesandreport(command, files, ...) +function resolvers.dowithfilesandreport(command, files, ...) -- will move if files and #files > 0 then if trace_locating then report('') -- ? @@ -1419,7 +1416,7 @@ function resolvers.booleanvariable(str,default) end end -function resolvers.dowithfilesintree(pattern,handle,before,after) -- can be a nice iterator instead +function resolvers.dowithfilesintree(pattern,handle,before,after) -- will move, can be a nice iterator instead local instance = resolvers.instance local hashes = instance.hashes for i=1,#hashes do diff --git a/tex/context/base/l-dir.lua b/tex/context/base/l-dir.lua index 2c4ff999b..878698b16 100644 --- a/tex/context/base/l-dir.lua +++ b/tex/context/base/l-dir.lua @@ -59,20 +59,22 @@ end --~ end local function globpattern(path,patt,recurse,action) - if path == "/" then - path = path .. "." - elseif not find(path,"/$") then - path = path .. '/' - end - for name in walkdir(path) do - local full = path .. name - local mode = attributes(full,'mode') - if mode == 'file' then - if find(full,patt) then - action(full) + if isdir(path) then + if path == "/" then + path = path .. "." + elseif not find(path,"/$") then + path = path .. '/' + end + for name in walkdir(path) do + local full = path .. name + local mode = attributes(full,'mode') + if mode == 'file' then + if find(full,patt) then + action(full) + end + elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then + globpattern(full,patt,recurse,action) end - elseif recurse and (mode == "directory") and (name ~= '.') and (name ~= "..") then - globpattern(full,patt,recurse,action) end end end diff --git a/tex/context/base/s-inf-01.mkvi b/tex/context/base/s-inf-01.mkvi index d32356d69..6a031a2ca 100644 --- a/tex/context/base/s-inf-01.mkvi +++ b/tex/context/base/s-inf-01.mkvi @@ -115,7 +115,7 @@ for k, v in table.sortedpairs(what) do for i=1,5 do if v[i] > max then max = v[i] end end end - return max, what, function(n) return max == 0 and 0 or n/max end + return max, what, function(n) return (max == 0 and 0) or (n == 0 and 0) or n/max end end function document.context_state_1(what) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 9d5df81af..4d63389e4 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 7f0cff144..7bab2db9a 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/31/11 22:31:46 +-- merge date : 02/01/11 14:24:59 do -- begin closure to overcome local limits and interference -- cgit v1.2.3