diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/data-res.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/data-res.lua | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/data-res.lua b/Master/texmf-dist/tex/context/base/data-res.lua index c3bb5bd48ab..33b1fe65274 100644 --- a/Master/texmf-dist/tex/context/base/data-res.lua +++ b/Master/texmf-dist/tex/context/base/data-res.lua @@ -411,10 +411,15 @@ local function locate_file_databases() local runtime = stripped == path path = resolvers.cleanpath(path) local spec = resolvers.splitmethod(stripped) - if spec.scheme == "cache" or spec.scheme == "file" then - stripped = spec.path - elseif runtime and (spec.noscheme or spec.scheme == "file") then + -- TH Original did this the other way around (elseif and if tests + -- reversed) but then the else branch was never reached, as 'runtime' + -- would effectively be ignored. In turn, that meant that the wrong + -- locator method was used, such that tree: and file: were treated + -- identically (cached and no runtime search). + if runtime and (spec.noscheme or spec.scheme == "file") then stripped = "tree:///" .. stripped + elseif spec.scheme == "cache" or spec.scheme == "file" then + stripped = spec.path end if trace_locating then if runtime then @@ -1047,22 +1052,31 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo : end if not done and doscan then -- check if on disk / unchecked / does not work at all / also zips + -- TH perhaps it did not work because of missing resolvers.resolve() + -- and resolvers.scanfiles() calls ... + pathname = resolvers.resolve(pathname) local scheme = url.hasscheme(pathname) if not scheme or scheme == "file" then local pname = gsub(pathname,"%.%*$",'') if not find(pname,"%*") then local ppname = gsub(pname,"/+$","") if can_be_dir(ppname) then - for k=1,#wantedfiles do - local w = wantedfiles[k] - local fname = filejoin(ppname,w) - if isreadable(fname) then - if trace_detail then - report_resolving("found '%s' by scanning",fname) + local files = resolvers.scanfiles(ppname) + if files then + for k=1,#wantedfiles do + local w = wantedfiles[k] + local subpath = files[w] + if subpath then + local fname = filejoin(ppname,subpath,w) + if isreadable(fname) then + if trace_detail then + report_resolving("found '%s' by scanning",fname) + end + result[#result+1] = fname + done = true + if not allresults then break end + end end - result[#result+1] = fname - done = true - if not allresults then break end end end else |