summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-04-27 18:26:21 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-04-27 18:26:21 +0200
commit9fceb52298c05c31666521b4226362322b18c178 (patch)
tree1fd1dd690b11060ba0782f10290be4d287cd3db7 /luaotfload-database.lua
parent90c3c46541e8508982254ee43eff8983a0444e66 (diff)
downloadluaotfload-9fceb52298c05c31666521b4226362322b18c178.tar.gz
update fontconfig test
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index edc3a5b..3085b63 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -86,12 +86,19 @@ config.luaotfload.resolver = config.luaotfload.resolver or "normal"
-- We use the cache.* of ConTeXt (see luat-basics-gen), we can
-- use it safely (all checks and directory creations are already done). It
-- uses TEXMFCACHE or TEXMFVAR as starting points.
-local writable_path = caches.getwritablepath("names","")
-if not writable_path then
- error("Impossible to find a suitable writeable cache...")
+local writable_path
+if caches then
+ writable_path = caches.getwritablepath("names","")
+ if not writable_path then
+ error("Impossible to find a suitable writeable cache...")
+ end
+ names.path.dir = writable_path
+ names.path.path = filejoin(writable_path, names.path.basename)
+else --- running as script, inject some dummies
+ caches = { }
+ logs = { report = function () end }
end
-names.path.dir = writable_path
-names.path.path = filejoin(writable_path, names.path.basename)
+
--[[doc--
Auxiliary functions