From dec452eb0a4019e59603e1167cd1161dc734c767 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 2 Apr 2019 11:11:36 -0300 Subject: manif: use temp dir if local cache can't be created --- src/luarocks/manif.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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) local cache_dir = dir.path(cfg.local_cache, name) local ok = fs.make_dir(cache_dir) if not ok then - return nil, "Failed creating temporary cache directory "..cache_dir + cfg.local_cache = fs.make_temp_dir("local_cache") + cache_dir = dir.path(cfg.local_cache, name) + ok = fs.make_dir(cache_dir) + if not ok then + return nil, "Failed creating temporary cache directory "..cache_dir + end end local file, err, errcode, from_cache = fetch.fetch_url(url, dir.path(cache_dir, filename), true) if not file then -- cgit v1.2.3-55-g6feb