diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fetch.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index 09f7a40b..24b3e1e5 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua | |||
@@ -36,6 +36,9 @@ function fetch.fetch_caching(url, mirroring) | |||
36 | local lock = ok and fs.lock_access(cache_dir) | 36 | local lock = ok and fs.lock_access(cache_dir) |
37 | if not (ok and lock) then | 37 | if not (ok and lock) then |
38 | cfg.local_cache = fs.make_temp_dir("local_cache") | 38 | cfg.local_cache = fs.make_temp_dir("local_cache") |
39 | if not cfg.local_cache then | ||
40 | return nil, "Failed creating temporary local_cache directory" | ||
41 | end | ||
39 | cache_dir = dir.path(cfg.local_cache, name) | 42 | cache_dir = dir.path(cfg.local_cache, name) |
40 | ok = fs.make_dir(cache_dir) | 43 | ok = fs.make_dir(cache_dir) |
41 | if not ok then | 44 | if not ok then |
@@ -209,7 +212,9 @@ function fetch.fetch_url_at_temp_dir(url, tmpname, filename, cache) | |||
209 | file = dir.path(temp_dir, filename) | 212 | file = dir.path(temp_dir, filename) |
210 | fs.copy(cachefile, file) | 213 | fs.copy(cachefile, file) |
211 | end | 214 | end |
212 | else | 215 | end |
216 | |||
217 | if not file then | ||
213 | file, err, errcode = fetch.fetch_url(url, filename, cache) | 218 | file, err, errcode = fetch.fetch_url(url, filename, cache) |
214 | end | 219 | end |
215 | 220 | ||