diff options
| author | luau-project <luau.project@gmail.com> | 2025-06-24 09:24:41 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2025-06-25 04:55:54 +0000 |
| commit | 7d82773f963d9c332533a47f10729f71d0031559 (patch) | |
| tree | f1bd73d6063072c47eaab257bdd0988c232d917b /src | |
| parent | 9fa5f6a8bbe01f1a207e1613478757f8a9dae83b (diff) | |
| download | luarocks-7d82773f963d9c332533a47f10729f71d0031559.tar.gz luarocks-7d82773f963d9c332533a47f10729f71d0031559.tar.bz2 luarocks-7d82773f963d9c332533a47f10729f71d0031559.zip | |
fetch: update cachefile and checkfile on temp local_cache
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fetch.lua | 4 |
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 | ||
