From c0f91f5db94dc92326e22af5d2ae56c97a8c587e Mon Sep 17 00:00:00 2001 From: hisham Date: Tue, 27 Oct 2009 15:48:03 +0000 Subject: fixes to improve behavior of 'add' git-svn-id: http://luarocks.org/svn/luarocks/trunk@115 9ca3f7c1-7366-0410-b1a3-b5c78f85698c --- src/luarocks/add.lua | 3 +++ src/luarocks/cache.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/add.lua b/src/luarocks/add.lua index f9d20782..2211a27a 100644 --- a/src/luarocks/add.lua +++ b/src/luarocks/add.lua @@ -52,6 +52,9 @@ local function add_file_to_server(refresh, rockfile, server, upload_server) else local_cache, protocol, server_path, user, password = cache.split_server_url(download_url, cfg.upload_user, cfg.upload_password) end + if not local_cache then + return nil, protocol + end if not login_url then login_url = protocol.."://"..server_path end diff --git a/src/luarocks/cache.lua b/src/luarocks/cache.lua index abf0a0fe..31594a7d 100644 --- a/src/luarocks/cache.lua +++ b/src/luarocks/cache.lua @@ -47,7 +47,7 @@ function refresh_local_cache(server, user, password) if password then login_info = login_info .. " --password="..password end -- TODO abstract away explicit 'wget' call - local ok = fs.execute("wget -q -m -nd "..protocol.."://"..server_path..login_info) + local ok = fs.execute("wget -q -m -np -nd "..protocol.."://"..server_path..login_info) if not ok then return nil, "Failed downloading cache." end -- cgit v1.2.3-55-g6feb