diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-02-19 17:46:26 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-02-19 17:46:26 +0100 |
commit | b5ef32a9a6a99e134e669b702e89a55fbabf5306 (patch) | |
tree | e0b152cee73c98ea43d93e707dad31bfdebc1ef0 /tex/context/base/mkiv/data-res.lua | |
parent | 601e63e757d4cf40d5923cee4b6b3debff57364c (diff) | |
download | context-b5ef32a9a6a99e134e669b702e89a55fbabf5306.tar.gz |
2017-02-19 17:20:00
Diffstat (limited to 'tex/context/base/mkiv/data-res.lua')
-rw-r--r-- | tex/context/base/mkiv/data-res.lua | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/tex/context/base/mkiv/data-res.lua b/tex/context/base/mkiv/data-res.lua index 24d53c343..4f171c445 100644 --- a/tex/context/base/mkiv/data-res.lua +++ b/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 @@ -376,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 |