summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-07-03 11:04:52 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-07-03 11:04:52 +0200
commit00fd07c628af41b0709d25fd00805385be561459 (patch)
treee946aacab408d2b2409018e9fef427c7a165a89a /luaotfload-database.lua
parent1a42a842639df21d4738bb8ac12f146d829a9d17 (diff)
downloadluaotfload-00fd07c628af41b0709d25fd00805385be561459.tar.gz
add cache directory hint to luaotfload-tool; manage paths more consistently
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index 338ffa6..c0aadaf 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -97,7 +97,8 @@ names.data = nil --- contains the loaded database
names.lookups = nil --- contains the lookup cache
names.path = {
dir = "", --- db and cache directory
- basename = "luaotfload-names.lua", --- db file name
+ basename = config.luaotfload.names_file
+ or "luaotfload-names.lua",
path = "", --- full path to db file
lookup_basename = "luaotfload-lookup-cache.lua", --- cache file name
lookup_path = "", --- cache full path
@@ -108,7 +109,7 @@ names.path = {
-- uses TEXMFCACHE or TEXMFVAR as starting points.
local writable_path
if caches then
- writable_path = caches.getwritablepath("names","")
+ writable_path = caches.getwritablepath "names"
if not writable_path then
luaotfload.error("Impossible to find a suitable writeable cache...")
end
@@ -2047,21 +2048,20 @@ end
local getwritablecachepath = function ( )
--- fonts.handlers.otf doesn’t exist outside a Luatex run,
--- so we have to improvise
- local writable = caches.getwritablepath ()
+ local writable = caches.getwritablepath
+ (config.luaotfload.cache_dir)
if writable then
- writable = writable .. "/fonts"
- if lfsisdir (writable) then
- return writable
- end
+ return writable
end
end
local getreadablecachepaths = function ( )
- local readables = caches.getreadablepaths ()
+ local readables = caches.getreadablepaths
+ (config.luaotfload.cache_dir)
local result = { }
if readables then
for i=1, #readables do
- local readable = readables[i] .. "/fonts"
+ local readable = readables[i]
if lfsisdir (readable) then
result[#result+1] = readable
end