diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fs/win32/tools.lua | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index 9e891fca..dcbd5701 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua | |||
| @@ -6,6 +6,7 @@ module("luarocks.fs.win32.tools", package.seeall) | |||
| 6 | 6 | ||
| 7 | local fs = require("luarocks.fs") | 7 | local fs = require("luarocks.fs") |
| 8 | local cfg = require("luarocks.cfg") | 8 | local cfg = require("luarocks.cfg") |
| 9 | local dir = require("luarocks.dir") | ||
| 9 | 10 | ||
| 10 | local dir_stack = {} | 11 | local dir_stack = {} |
| 11 | 12 | ||
| @@ -253,15 +254,21 @@ end | |||
| 253 | function download(url, filename) | 254 | function download(url, filename) |
| 254 | assert(type(url) == "string") | 255 | assert(type(url) == "string") |
| 255 | assert(type(filename) == "string" or not filename) | 256 | assert(type(filename) == "string" or not filename) |
| 256 | local wget_cmd = "wget --cache=off --user-agent="..cfg.user_agent.." --quiet --continue " | ||
| 257 | 257 | ||
| 258 | if filename then | 258 | if cfg.downloader == "wget" then |
| 259 | return fs.execute(wget_cmd.." --output-document ", filename, url) | 259 | local wget_cmd = "wget --no-check-certificate --no-cache --user-agent="..cfg.user_agent.." --quiet --continue " |
| 260 | else | 260 | if filename then |
| 261 | return fs.execute(wget_cmd, url) | 261 | return fs.execute(wget_cmd.." --output-document ", filename, url) |
| 262 | else | ||
| 263 | return fs.execute(wget_cmd, url) | ||
| 264 | end | ||
| 265 | elseif cfg.downloader == "curl" then | ||
| 266 | filename = filename or dir.base_name(url) | ||
| 267 | return fs.execute_string("curl -L --user-agent "..cfg.user_agent.." "..fs.Q(url).." 2> NUL 1> "..fs.Q(filename)) | ||
| 262 | end | 268 | end |
| 263 | end | 269 | end |
| 264 | 270 | ||
| 271 | |||
| 265 | --- Compress files in a .zip archive. | 272 | --- Compress files in a .zip archive. |
| 266 | -- @param zipfile string: pathname of .zip archive to be created. | 273 | -- @param zipfile string: pathname of .zip archive to be created. |
| 267 | -- @param ... Filenames to be stored in the archive are given as | 274 | -- @param ... Filenames to be stored in the archive are given as |
