diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-18 22:21:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-18 22:21:33 +0000 |
commit | 2472c585a2dee03ef4665514cb651e5976fd134a (patch) | |
tree | cb0475ebdca2ed9ee248dd809f6bcce1671a0afb /Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua | |
parent | 542dd7f24e76ac20da26d1c4d7ceb69baa248133 (diff) |
luaotfload (18may13)
git-svn-id: svn://tug.org/texlive/trunk@30561 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua index 61f3910ebb7..0561778b4cd 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-basics-gen.lua @@ -11,9 +11,14 @@ if context then os.exit() end -local dummyfunction = function() end ------ dummyreporter = function(c) return function(...) texio.write_nl(c .. " : " .. string.format(...)) end end -local dummyreporter = function(c) return function(...) texio.write_nl(c .. " : " .. string.formatters(...)) end end +local dummyfunction = function() +end + +local dummyreporter = function(c) + return function(...) + (texio.reporter or texio.write_nl)(c .. " : " .. string.formatters(...)) + end +end statistics = { register = dummyfunction, @@ -140,16 +145,24 @@ end do + -- standard context tree setup + local cachepaths = kpse.expand_path('$TEXMFCACHE') or "" + -- quite like tex live or so + if cachepaths == "" then cachepaths = kpse.expand_path('$TEXMFVAR') end + -- this also happened to be used + if cachepaths == "" then cachepaths = kpse.expand_path('$VARTEXMF') end + -- and this is a last resort + if cachepaths == "" then cachepaths = "." end @@ -157,8 +170,15 @@ do cachepaths = string.split(cachepaths,os.type == "windows" and ";" or ":") for i=1,#cachepaths do - if file.is_writable(cachepaths[i]) then - writable = file.join(cachepaths[i],"luatex-cache") + local cachepath = cachepaths[i] + if not lfs.isdir(cachepath) then + lfs.mkdirs(cachepath) -- needed for texlive and latex + if lfs.isdir(cachepath) then + texio.write(string.format("(created cache path: %s)",cachepath)) + end + end + if file.is_writable(cachepath) then + writable = file.join(cachepath,"luatex-cache") lfs.mkdir(writable) writable = file.join(writable,caches.namespace) lfs.mkdir(writable) @@ -205,7 +225,6 @@ end local function makefullname(path,name) if path and path ~= "" then - name = "temp-" .. name -- clash prevention return file.addsuffix(file.join(path,name),"lua"), file.addsuffix(file.join(path,name),usingjit and "lub" or "luc") end end @@ -290,7 +309,7 @@ function caches.compile(data,luaname,lucname) d = table.serialize(data,true) -- slow end if d and d ~= "" then - local f = io.open(lucname,'w') + local f = io.open(lucname,'wb') if f then local s = loadstring(d) if s then |