summaryrefslogtreecommitdiff
path: root/tex/generic/context/luatex/luatex-basics-gen.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-05-16 01:40:21 +0300
committerMarius <mariausol@gmail.com>2013-05-16 01:40:21 +0300
commitf8fd2c3a541d9d0cc8a093facc0ed0abf317527c (patch)
tree6e742c191b8d5079ca565c2b60687397807e5d37 /tex/generic/context/luatex/luatex-basics-gen.lua
parentaf60db62dbf468522f21a4ad4461f1a505d8161c (diff)
downloadcontext-f8fd2c3a541d9d0cc8a093facc0ed0abf317527c.tar.gz
beta 2013.05.16 00:29
Diffstat (limited to 'tex/generic/context/luatex/luatex-basics-gen.lua')
-rw-r--r--tex/generic/context/luatex/luatex-basics-gen.lua19
1 files changed, 17 insertions, 2 deletions
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)