aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-03-22 11:02:38 -0300
committerHisham Muhammad <hisham@gobolinux.org>2011-03-22 11:02:38 -0300
commitc55a52b0eaa753ed00d12b6553777b9ab913101d (patch)
tree4235546b6cca66b9559b818cc2375817c8ec19bd
parentd4ed388021fda732cb08d95844949457fad9631a (diff)
downloadluarocks-c55a52b0eaa753ed00d12b6553777b9ab913101d.tar.gz
luarocks-c55a52b0eaa753ed00d12b6553777b9ab913101d.tar.bz2
luarocks-c55a52b0eaa753ed00d12b6553777b9ab913101d.zip
Add support for curl on Windows (untested)
-rw-r--r--src/luarocks/fs/win32/tools.lua17
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
7local fs = require("luarocks.fs") 7local fs = require("luarocks.fs")
8local cfg = require("luarocks.cfg") 8local cfg = require("luarocks.cfg")
9local dir = require("luarocks.dir")
9 10
10local dir_stack = {} 11local dir_stack = {}
11 12
@@ -253,15 +254,21 @@ end
253function download(url, filename) 254function 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
263end 269end
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