diff options
| author | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-05-16 02:27:11 -0700 | 
|---|---|---|
| committer | Elie Roux <elie.roux@telecom-bretagne.eu> | 2013-05-16 02:27:11 -0700 | 
| commit | 1e629e2d39ceeca74aebc4786bcc79fe59a8ae16 (patch) | |
| tree | 2e05507117aa41955a1c0096532107c151567b79 /luaotfload-merged.lua | |
| parent | 087a990dc8581be3a2980034e70f874d52f9577b (diff) | |
| parent | f75c554094c233227426668fed6192b9711c4304 (diff) | |
| download | luaotfload-1e629e2d39ceeca74aebc4786bcc79fe59a8ae16.tar.gz | |
Merge pull request #76 from phi-gamma/master
leave creating cache directories to the fontloader
Diffstat (limited to 'luaotfload-merged.lua')
| -rw-r--r-- | luaotfload-merged.lua | 30 | 
1 files changed, 25 insertions, 5 deletions
| diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua index 14667bd..ffb0016 100644 --- a/luaotfload-merged.lua +++ b/luaotfload-merged.lua @@ -1,6 +1,6 @@  -- merged file : luatex-fonts-merged.lua  -- parent file : luatex-fonts.lua --- merge date  : 05/14/13 23:14:52 +-- 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, | 
