diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-03-31 12:39:16 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-03-31 12:39:16 -0300 |
commit | 489b99032f06cbdd67745be859098a10019dfad0 (patch) | |
tree | 44d12945ddb2a077c9cef988a64ddc5bac7dfa9b | |
parent | 0842090c78d9719ccfda41914daed19ef81df515 (diff) | |
download | luarocks-489b99032f06cbdd67745be859098a10019dfad0.tar.gz luarocks-489b99032f06cbdd67745be859098a10019dfad0.tar.bz2 luarocks-489b99032f06cbdd67745be859098a10019dfad0.zip |
Add -f flag to curl, to improve error handling, as suggested in #244.
-rw-r--r-- | src/luarocks/fs/unix/tools.lua | 2 | ||||
-rw-r--r-- | src/luarocks/fs/win32/tools.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index 8a71171d..d381b8d9 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua | |||
@@ -259,7 +259,7 @@ function tools.download(url, filename, cache) | |||
259 | ok = fs.execute(wget_cmd, url) | 259 | ok = fs.execute(wget_cmd, url) |
260 | end | 260 | end |
261 | elseif cfg.downloader == "curl" then | 261 | elseif cfg.downloader == "curl" then |
262 | ok = fs.execute_string(vars.CURL.." -L --user-agent '"..cfg.user_agent.." via curl' "..fs.Q(url).." 2> /dev/null 1> "..fs.Q(filename)) | 262 | 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)) |
263 | end | 263 | end |
264 | if ok then | 264 | if ok then |
265 | return true, filename | 265 | return true, filename |
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index abf3779f..bd7ba086 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua | |||
@@ -269,7 +269,7 @@ function tools.download(url, filename, cache) | |||
269 | ok = fs.execute(wget_cmd..fs.Q(url).." 2> NUL 1> NUL") | 269 | ok = fs.execute(wget_cmd..fs.Q(url).." 2> NUL 1> NUL") |
270 | end | 270 | end |
271 | elseif cfg.downloader == "curl" then | 271 | elseif cfg.downloader == "curl" then |
272 | ok = fs.execute_string(fs.Q(vars.CURL).." -L --user-agent \""..cfg.user_agent.." via curl\" "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename)) | 272 | 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)) |
273 | end | 273 | end |
274 | if ok then | 274 | if ok then |
275 | return true, filename | 275 | return true, filename |