diff options
-rw-r--r-- | src/luarocks/cache.lua | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/luarocks/cache.lua b/src/luarocks/cache.lua index dbea8405..fb6344d8 100644 --- a/src/luarocks/cache.lua +++ b/src/luarocks/cache.lua | |||
@@ -45,25 +45,12 @@ function cache.split_server_url(server, url, user, password) | |||
45 | user = credentials | 45 | user = credentials |
46 | end | 46 | end |
47 | end | 47 | end |
48 | local local_cache | 48 | local local_cache = cfg.local_cache .. "/" .. server |
49 | if cfg.local_cache then | ||
50 | local_cache = cfg.local_cache .. "/" .. server | ||
51 | end | ||
52 | return local_cache, protocol, server_path, user, password | 49 | return local_cache, protocol, server_path, user, password |
53 | end | 50 | end |
54 | 51 | ||
55 | function cache.refresh_local_cache(server, url, user, password) | 52 | function cache.refresh_local_cache(server, url, user, password) |
56 | local local_cache, protocol, server_path, user, password = cache.split_server_url(server, url, user, password) | 53 | local local_cache, protocol, server_path, user, password = cache.split_server_url(server, url, user, password) |
57 | |||
58 | local ok, err = fs.make_dir(cfg.local_cache) | ||
59 | if not ok then return nil, err end | ||
60 | |||
61 | local tmp_cache = false | ||
62 | if not local_cache then | ||
63 | local err | ||
64 | local_cache, err = fs.make_temp_dir("local_cache") | ||
65 | tmp_cache = true | ||
66 | end | ||
67 | local ok, err = fs.make_dir(local_cache) | 54 | local ok, err = fs.make_dir(local_cache) |
68 | if not ok then | 55 | if not ok then |
69 | return nil, "Failed creating local cache dir: "..err | 56 | return nil, "Failed creating local cache dir: "..err |