From 63820f899cf8f35b2274b04e76b15b168213bd33 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 3 Apr 2014 11:15:09 -0300 Subject: Add -k flag so that curl behavior matches that of wget. Also, make win32 and unix code more similar (we're almost to the point where we could have a single implementation for both!) --- src/luarocks/fs/unix/tools.lua | 10 +++++----- src/luarocks/fs/win32/tools.lua | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index d381b8d9..aadb9b07 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua @@ -246,20 +246,20 @@ function tools.download(url, filename, cache) local ok if cfg.downloader == "wget" then - local wget_cmd = vars.WGET.." --no-check-certificate --no-cache --user-agent='"..cfg.user_agent.." via wget' --quiet " + local wget_cmd = fs.Q(vars.WGET).." --no-check-certificate --no-cache --user-agent='"..cfg.user_agent.." via wget' --quiet " if cache then -- --timestamping is incompatible with --output-document, -- but that's not a problem for our use cases. fs.change_dir(dir.dir_name(filename)) - ok = fs.execute(wget_cmd.." --timestamping ", url) + ok = fs.execute_quiet(wget_cmd.." --timestamping ", url) fs.pop_dir() elseif filename then - ok = fs.execute(wget_cmd.." --output-document "..fs.Q(filename), url) + ok = fs.execute_quiet(wget_cmd.." --output-document ", filename, url) else - ok = fs.execute(wget_cmd, url) + ok = fs.execute_quiet(wget_cmd, url) end elseif cfg.downloader == "curl" then - ok = fs.execute_string(vars.CURL.." -f -L --user-agent '"..cfg.user_agent.." via curl' "..fs.Q(url).." 2> /dev/null 1> "..fs.Q(filename)) + ok = fs.execute_string(fs.Q(vars.CURL).." -f -k -L --user-agent '"..cfg.user_agent.." via curl' "..fs.Q(url).." 2> /dev/null 1> "..fs.Q(filename)) end if ok then return true, filename diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index bd7ba086..fbd8b6e4 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua @@ -261,15 +261,15 @@ function tools.download(url, filename, cache) -- --timestamping is incompatible with --output-document, -- but that's not a problem for our use cases. fs.change_dir(dir.dir_name(filename)) - ok = fs.execute(wget_cmd.." --timestamping "..fs.Q(url).." 2> NUL 1> NUL") + ok = fs.execute_quiet(wget_cmd.." --timestamping ", url) fs.pop_dir() elseif filename then - ok = fs.execute(wget_cmd.." --output-document "..fs.Q(filename).." "..fs.Q(url).." 2> NUL 1> NUL") + ok = fs.execute_quiet(wget_cmd.." --output-document ", filename, url) else - ok = fs.execute(wget_cmd..fs.Q(url).." 2> NUL 1> NUL") + ok = fs.execute_quiet(wget_cmd, url) end elseif cfg.downloader == "curl" then - ok = fs.execute_string(fs.Q(vars.CURL).." -f -L --user-agent \""..cfg.user_agent.." via curl\" "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename)) + ok = fs.execute_string(fs.Q(vars.CURL).." -f -k -L --user-agent \""..cfg.user_agent.." via curl\" "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename)) end if ok then return true, filename -- cgit v1.2.3-55-g6feb