diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-07-23 15:38:32 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-07-23 15:38:32 -0700 |
commit | daeb3c1fddf826deb325cbe2a6567083c828ca13 (patch) | |
tree | 12aed96922ab72b4889899d8b4499d5e1600362a /luaotfload-basics-gen.lua | |
parent | 36abb3e8cf8d2d24bf5cfb770cdba2731de655c5 (diff) | |
parent | 2331b6838f623d4800e79e92c50ce55f955d7776 (diff) | |
download | luaotfload-daeb3c1fddf826deb325cbe2a6567083c828ca13.tar.gz |
Merge pull request #111 from phi-gamma/master
update to v2.3b
Diffstat (limited to 'luaotfload-basics-gen.lua')
-rw-r--r-- | luaotfload-basics-gen.lua | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/luaotfload-basics-gen.lua b/luaotfload-basics-gen.lua index a5da2fd..26c1edc 100644 --- a/luaotfload-basics-gen.lua +++ b/luaotfload-basics-gen.lua @@ -149,19 +149,29 @@ do local cachepaths = kpse.expand_var('$TEXMFCACHE') or "" - -- quite like tex live or so + -- quite like tex live or so (the weird $TEXMFCACHE test seems to be needed on miktex) - if cachepaths == "$TEXMFCACHE" then + if cachepaths == "" or cachepaths == "$TEXMFCACHE" then cachepaths = kpse.expand_var('$TEXMFVAR') or "" end - -- this also happened to be used + -- this also happened to be used (the weird $TEXMFVAR test seems to be needed on miktex) - if cachepaths == "$TEXMFVAR" then + if cachepaths == "" or cachepaths == "$TEXMFVAR" then cachepaths = kpse.expand_var('$VARTEXMF') or "" end - -- and this is a last resort + -- and this is a last resort (hm, we could use TEMP or TEMPDIR) + + if cachepaths == "" then + local fallbacks = { "TMPDIR", "TEMPDIR", "TMP", "TEMP", "HOME", "HOMEPATH" } + for i=1,#fallbacks do + cachepaths = os.getenv(fallbacks[i]) or "" + if cachepath ~= "" and lfs.isdir(cachepath) then + break + end + end + end if cachepaths == "" then cachepaths = "." @@ -267,7 +277,7 @@ function caches.savedata(path,name,data) local luaname, lucname = makefullname(path,name) if luaname then texio.write(string.format("(save: %s)",luaname)) - table.tofile(luaname,data,true,{ reduce = true }) + table.tofile(luaname,data,true) if lucname and type(caches.compile) == "function" then os.remove(lucname) -- better be safe texio.write(string.format("(save: %s)",lucname)) |