summaryrefslogtreecommitdiff
path: root/tex/context/base/data-tmp.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-03-16 15:00:13 +0200
committerMarius <mariausol@gmail.com>2013-03-16 15:00:13 +0200
commitb5c32dcb87bebcda5741a31992462bf543620da1 (patch)
treeb9140707eada16df7e2951382f8f2704fea8c889 /tex/context/base/data-tmp.lua
parent239fc2639fd42f6ad1c44bb256ae2f98ed164b45 (diff)
downloadcontext-b5c32dcb87bebcda5741a31992462bf543620da1.tar.gz
beta 2013.03.16 13:40
Diffstat (limited to 'tex/context/base/data-tmp.lua')
-rw-r--r--tex/context/base/data-tmp.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/tex/context/base/data-tmp.lua b/tex/context/base/data-tmp.lua
index c9180dba6..525698d1e 100644
--- a/tex/context/base/data-tmp.lua
+++ b/tex/context/base/data-tmp.lua
@@ -24,7 +24,7 @@ luatools with a recache feature.</p>
local format, lower, gsub, concat = string.format, string.lower, string.gsub, table.concat
local serialize, serializetofile = table.serialize, table.tofile
-local mkdirs, isdir = dir.mkdirs, lfs.isdir
+local mkdirs, isdir, isfile = dir.mkdirs, lfs.isdir, lfs.isfile
local addsuffix, is_writable, is_readable = file.addsuffix, file.is_writable, file.is_readable
local formatters = string.formatters
@@ -279,12 +279,19 @@ function caches.loaddata(readables,name)
for i=1,#readables do
local path = readables[i]
local tmaname, tmcname = caches.setluanames(path,name)
- local loader = loadfile(tmcname)
- if not loader then
+ local loader = false
+ if isfile(tmcname) then
+ loader = loadfile(tmcname)
+ end
+ if not loader and isfile(tmaname) then
-- in case we have a different engine
utilities.lua.compile(tmaname,tmcname)
- --
- loader = loadfile(tmaname)
+ if isfile(tmcname) then
+ loader = loadfile(tmcname)
+ end
+ if not loader then
+ loader = loadfile(tmaname)
+ end
end
if loader then
loader = loader()