From f8fd2c3a541d9d0cc8a093facc0ed0abf317527c Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 16 May 2013 01:40:21 +0300 Subject: beta 2013.05.16 00:29 --- tex/generic/context/luatex/luatex-basics-gen.lua | 19 ++++++++++++-- tex/generic/context/luatex/luatex-fonts-merged.lua | 30 ++++++++++++++++++---- 2 files changed, 42 insertions(+), 7 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex/luatex-basics-gen.lua b/tex/generic/context/luatex/luatex-basics-gen.lua index 1c4357fbc..0561778b4 100644 --- a/tex/generic/context/luatex/luatex-basics-gen.lua +++ b/tex/generic/context/luatex/luatex-basics-gen.lua @@ -145,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 @@ -162,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) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 37775d1f5..ffb001601 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/15/13 09:58:43 +-- merge date : 05/16/13 00:29:34 do -- begin closure to overcome local limits and interference @@ -1986,7 +1986,7 @@ elseif not lfs.isfile then end end local insert,concat=table.insert,table.concat -local match,find=string.match,string.find +local match,find,gmatch=string.match,string.find,string.gmatch local lpegmatch=lpeg.match local getcurrentdir,attributes=lfs.currentdir,lfs.attributes local checkedsplit=string.checkedsplit @@ -2299,6 +2299,19 @@ function file.strip(name,dir) return a~="" and a or name end end +function lfs.mkdirs(path) + local full + for sub in gmatch(path,"([^\\/]+)") do + if full then + full=full.."/"..sub + else + full=sub + end + if not lfs.isdir(full) then + lfs.mkdir(full) + end + end +end end -- closure @@ -3006,8 +3019,15 @@ do end 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) + 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) @@ -6809,7 +6829,7 @@ local function checkmathsize(tfmdata,mathsize) end registerotffeature { name="mathsize", - description="apply mathsize as specified in the font", + description="apply mathsize specified in the font", initializers={ base=checkmathsize, node=checkmathsize, -- cgit v1.2.3