From 7d82773f963d9c332533a47f10729f71d0031559 Mon Sep 17 00:00:00 2001 From: luau-project Date: Tue, 24 Jun 2025 09:24:41 -0300 Subject: fetch: update cachefile and checkfile on temp local_cache --- src/luarocks/fetch.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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) local cachefile = dir.path(cache_dir, filename) local checkfile = cachefile .. ".check" - if (fs.file_age(checkfile) < 10 or + if (fs.exists(checkfile) and fs.file_age(checkfile) < 10 or cfg.aggressive_cache and (not name:match("^manifest"))) and fs.exists(cachefile) then return cachefile, nil, nil, true @@ -75,6 +75,8 @@ function fetch.fetch_caching(url, mirroring) if not ok then return nil, "Failed creating temporary cache directory " .. cache_dir end + cachefile = dir.path(cache_dir, filename) + checkfile = cachefile .. ".check" lock = fs.lock_access(cache_dir) end -- cgit v1.2.3-55-g6feb