diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-04-02 11:11:36 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-04-03 10:44:51 -0300 |
commit | dec452eb0a4019e59603e1167cd1161dc734c767 (patch) | |
tree | 0afd24f90a1b95d630d07a74287b1ede6586993e /src | |
parent | d2423f481ed3699ce9ebf4013e346510350c8a0e (diff) | |
download | luarocks-dec452eb0a4019e59603e1167cd1161dc734c767.tar.gz luarocks-dec452eb0a4019e59603e1167cd1161dc734c767.tar.bz2 luarocks-dec452eb0a4019e59603e1167cd1161dc734c767.zip |
manif: use temp dir if local cache can't be created
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/manif.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index 9026bc5b..45130696 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua | |||
@@ -72,7 +72,12 @@ local function fetch_manifest_from(repo_url, filename) | |||
72 | local cache_dir = dir.path(cfg.local_cache, name) | 72 | local cache_dir = dir.path(cfg.local_cache, name) |
73 | local ok = fs.make_dir(cache_dir) | 73 | local ok = fs.make_dir(cache_dir) |
74 | if not ok then | 74 | if not ok then |
75 | return nil, "Failed creating temporary cache directory "..cache_dir | 75 | cfg.local_cache = fs.make_temp_dir("local_cache") |
76 | cache_dir = dir.path(cfg.local_cache, name) | ||
77 | ok = fs.make_dir(cache_dir) | ||
78 | if not ok then | ||
79 | return nil, "Failed creating temporary cache directory "..cache_dir | ||
80 | end | ||
76 | end | 81 | end |
77 | local file, err, errcode, from_cache = fetch.fetch_url(url, dir.path(cache_dir, filename), true) | 82 | local file, err, errcode, from_cache = fetch.fetch_url(url, dir.path(cache_dir, filename), true) |
78 | if not file then | 83 | if not file then |