summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-11-28 14:58:19 +0100
committerPhilipp Gesang <phg@phi-gamma.net>2015-11-28 14:58:24 +0100
commit78a1273715f8681fe8cb013b9699df11bfa56eaa (patch)
tree69f0c11896133bc487317d47c0fa70c9f43c14e6
parent91ae11f974db282b675e8582fab2c1bd5eb1f13b (diff)
downloadluaotfload-78a1273715f8681fe8cb013b9699df11bfa56eaa.tar.gz
[diagnose] adapt invocation of getwritablepath()
Some upstream API change (possibly in file.join()) caused that function to emit relative paths. file.join("/foo", "bar") --> good file.join("/foo", "" ) --> good file.join("/foo" ) --> wtf‽
-rw-r--r--src/luaotfload-diagnostics.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/luaotfload-diagnostics.lua b/src/luaotfload-diagnostics.lua
index 582105a..cd5082c 100644
--- a/src/luaotfload-diagnostics.lua
+++ b/src/luaotfload-diagnostics.lua
@@ -171,6 +171,11 @@ local get_permissions = function (t, location)
location = lpegmatch (stripslashes, location)
end
local attributes = lfsattributes (location)
+ if not attributes then
+ print""
+ print("attr", location, attributes)
+ os.exit()
+ end
if not attributes and t == "f" then
attributes = get_tentative_attributes (location)
@@ -238,12 +243,10 @@ local check_conformance = function (spec, permissions, errcnt)
return errcnt
end
-local desired_permissions
local init_desired_permissions = function ()
- inspect(config.luaotfload.paths)
local paths = config.luaotfload.paths
- desired_permissions = {
- { "d", {"r","w"}, function () return caches.getwritablepath () end },
+ return {
+ { "d", {"r","w"}, function () return caches.getwritablepath ("", "") end },
{ "d", {"r","w"}, paths.prefix },
{ "f", {"r","w"}, paths.index_path_lua .. ".gz" },
{ "f", {"r","w"}, paths.index_path_luc },
@@ -254,7 +257,7 @@ end
local check_permissions = function (errcnt)
out [[=============== file permissions ==============]]
- if not desired_permissions then init_desired_permissions () end
+ local desired_permissions = init_desired_permissions ()
for i = 1, #desired_permissions do
local t, spec, path = unpack (desired_permissions[i])
if type (path) == "function" then