aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fetch.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua
index 07c4bf94..bcee6f23 100644
--- a/src/luarocks/fetch.lua
+++ b/src/luarocks/fetch.lua
@@ -54,7 +54,7 @@ function fetch.fetch_caching(url, mirroring)
54 local cachefile = dir.path(cache_dir, filename) 54 local cachefile = dir.path(cache_dir, filename)
55 local checkfile = cachefile .. ".check" 55 local checkfile = cachefile .. ".check"
56 56
57 if (fs.file_age(checkfile) < 10 or 57 if (fs.exists(checkfile) and fs.file_age(checkfile) < 10 or
58 cfg.aggressive_cache and (not name:match("^manifest"))) and fs.exists(cachefile) then 58 cfg.aggressive_cache and (not name:match("^manifest"))) and fs.exists(cachefile) then
59 59
60 return cachefile, nil, nil, true 60 return cachefile, nil, nil, true
@@ -75,6 +75,8 @@ function fetch.fetch_caching(url, mirroring)
75 if not ok then 75 if not ok then
76 return nil, "Failed creating temporary cache directory " .. cache_dir 76 return nil, "Failed creating temporary cache directory " .. cache_dir
77 end 77 end
78 cachefile = dir.path(cache_dir, filename)
79 checkfile = cachefile .. ".check"
78 lock = fs.lock_access(cache_dir) 80 lock = fs.lock_access(cache_dir)
79 end 81 end
80 82