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-tmp.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-tmp.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua b/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua index 9e1515a2650..eabfce96e5d 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua @@ -256,22 +256,22 @@ caches.getwritablepath = getwritablepath -- use e.g. a home path where we have updated file databases and so maybe we need -- to check first if we do have a writable one -function caches.getfirstreadablefile(filename,...) - local rd = getreadablepaths(...) - for i=1,#rd do - local path = rd[i] - local fullname = file.join(path,filename) - if is_readable(fullname) then - usedreadables[i] = true - return fullname, path - end - end - return caches.setfirstwritablefile(filename,...) -end +-- function caches.getfirstreadablefile(filename,...) +-- local rd = getreadablepaths(...) +-- for i=1,#rd do +-- local path = rd[i] +-- local fullname = file.join(path,filename) +-- if is_readable(fullname) then +-- usedreadables[i] = true +-- return fullname, path +-- end +-- end +-- return caches.setfirstwritablefile(filename,...) +-- end -- next time we have an issue, we can test this instead: -function caches.getfirstreadablefile_TEST_ME_FIRST(filename,...) +function caches.getfirstreadablefile(filename,...) -- check if we have already written once local fullname, path = caches.setfirstwritablefile(filename,...) if is_readable(fullname) then @@ -297,7 +297,7 @@ function caches.setfirstwritablefile(filename,...) return fullname, wr end -function caches.define(category,subcategory) -- for old times sake +function caches.define(category,subcategory) -- not used return function() return getwritablepath(category,subcategory) end @@ -307,19 +307,31 @@ function caches.setluanames(path,name) return format("%s/%s.%s",path,name,luasuffixes.tma), format("%s/%s.%s",path,name,luasuffixes.tmc) end -function caches.loaddata(readables,name) +-- This works best if the first writable is the first readable too. In practice +-- we can have these situations for file databases: +-- +-- tma in readable +-- tma + tmb/c in readable +-- +-- runtime files like fonts are written to the writable cache anyway + +function caches.loaddata(readables,name,writable) if type(readables) == "string" then readables = { readables } end for i=1,#readables do - local path = readables[i] - local tmaname, tmcname = caches.setluanames(path,name) + local path = readables[i] local loader = false + local tmaname, tmcname = caches.setluanames(path,name) if isfile(tmcname) then loader = loadfile(tmcname) end if not loader and isfile(tmaname) then - -- in case we have a different engine + -- can be different paths when we read a file database from disk + local tmacrap, tmcname = caches.setluanames(writable,name) + if isfile(tmcname) then + loader = loadfile(tmcname) + end utilities.lua.compile(tmaname,tmcname) if isfile(tmcname) then loader = loadfile(tmcname) |