diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-19 23:04:15 +0000 |
commit | f74161ca4e7eb3c5af9afcbe92522ae3b58987c1 (patch) | |
tree | 3c30a13df5ac7968195c85070a2b074578e669d2 /Master/texmf-dist/tex/context/base/mkiv/data-res.lua | |
parent | 1d5a55ac8f5506a7ae9cfca52f4b588182e199d4 (diff) |
context beta/cont-tmf.zip (Apr 16 12:55)
git-svn-id: svn://tug.org/texlive/trunk@43931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/data-res.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/data-res.lua | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-res.lua b/Master/texmf-dist/tex/context/base/mkiv/data-res.lua index 831ad881c2b..4f171c445b1 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/data-res.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/data-res.lua @@ -69,12 +69,13 @@ local initializesetter = utilities.setters.initialize local ostype, osname, osenv, ossetenv, osgetenv = os.type, os.name, os.env, os.setenv, os.getenv -resolvers.cacheversion = "1.100" -resolvers.configbanner = "" -resolvers.homedir = environment.homedir -resolvers.criticalvars = allocate { "SELFAUTOLOC", "SELFAUTODIR", "SELFAUTOPARENT", "TEXMFCNF", "TEXMF", "TEXOS" } -resolvers.luacnfname = "texmfcnf.lua" -resolvers.luacnfstate = "unknown" +resolvers.cacheversion = "1.100" +resolvers.configbanner = "" +resolvers.homedir = environment.homedir +resolvers.criticalvars = allocate { "SELFAUTOLOC", "SELFAUTODIR", "SELFAUTOPARENT", "TEXMFCNF", "TEXMF", "TEXOS" } +resolvers.luacnfname = "texmfcnf.lua" +resolvers.luacnffallback = "contextcnf.lua" +resolvers.luacnfstate = "unknown" -- The web2c tex binaries as well as kpse have built in paths for the configuration -- files and there can be a depressing truckload of them. This is actually the weak @@ -198,7 +199,6 @@ end local dollarstripper = lpeg.stripper("$") local inhibitstripper = P("!")^0 * Cs(P(1)^0) -local backslashswapper = lpeg.replacer("\\","/") local somevariable = P("$") / "" local somekey = C(R("az","AZ","09","__","--")^1) @@ -377,24 +377,32 @@ local function identify_configuration_files() end reportcriticalvariables(cnfspec) local cnfpaths = expandedpathfromlist(resolvers.splitpath(cnfspec)) - local luacnfname = resolvers.luacnfname - for i=1,#cnfpaths do - local filepath = cnfpaths[i] - local filename = collapsepath(filejoin(filepath,luacnfname)) - local realname = resolveprefix(filename) -- can still have "//" ... needs checking - -- todo: environment.skipweirdcnfpaths directive - if trace_locating then - local fullpath = gsub(resolveprefix(collapsepath(filepath)),"//","/") - local weirdpath = find(fullpath,"/texmf.+/texmf") or not find(fullpath,"/web2c",1,true) - report_resolving("looking for %a on %s path %a from specification %a",luacnfname,weirdpath and "weird" or "given",fullpath,filepath) - end - if isfile(realname) then - specification[#specification+1] = filename -- unresolved as we use it in matching, relocatable + + local function locatecnf(luacnfname,kind) + for i=1,#cnfpaths do + local filepath = cnfpaths[i] + local filename = collapsepath(filejoin(filepath,luacnfname)) + local realname = resolveprefix(filename) -- can still have "//" ... needs checking + -- todo: environment.skipweirdcnfpaths directive if trace_locating then - report_resolving("found configuration file %a",realname) + local fullpath = gsub(resolveprefix(collapsepath(filepath)),"//","/") + local weirdpath = find(fullpath,"/texmf.+/texmf") or not find(fullpath,"/web2c",1,true) + report_resolving("looking for %s %a on %s path %a from specification %a", + kind,luacnfname,weirdpath and "weird" or "given",fullpath,filepath) + end + if isfile(realname) then + specification[#specification+1] = filename -- unresolved as we use it in matching, relocatable + if trace_locating then + report_resolving("found %s configuration file %a",kind,realname) + end end end end + + locatecnf(resolvers.luacnfname,"regular") + if #specification == 0 then + locatecnf(resolvers.luacnffallback,"fallback") + end if trace_locating then report_resolving() end |