diff options
-rw-r--r-- | src/luarocks/fetch.lua | 7 | ||||
-rw-r--r-- | src/luarocks/fetch/hg.lua | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index 98e10609..9b946684 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua | |||
@@ -294,14 +294,15 @@ function fetch_sources(rockspec, extract, dest_dir) | |||
294 | assert(type(dest_dir) == "string" or not dest_dir) | 294 | assert(type(dest_dir) == "string" or not dest_dir) |
295 | 295 | ||
296 | local protocol = rockspec.source.protocol | 296 | local protocol = rockspec.source.protocol |
297 | local vccs = rockspec.source.protocol | 297 | local vccs = rockspec.source.vccs |
298 | |||
298 | local ok, proto | 299 | local ok, proto |
299 | if vccs == nil or ( protocol == "http" or protocol == "https" or protocol == "ftp" or protocol == "file" ) then | 300 | if vccs == nil and ( protocol == "http" or protocol == "https" or protocol == "ftp" or protocol == "file" ) then |
300 | proto = require("luarocks.fetch") | 301 | proto = require("luarocks.fetch") |
301 | else | 302 | else |
302 | ok, proto = pcall(require, "luarocks.fetch."..vccs or protocol) | 303 | ok, proto = pcall(require, "luarocks.fetch."..vccs or protocol) |
303 | if not ok then | 304 | if not ok then |
304 | return nil, "Unknown protocol "..protocol | 305 | return nil, "Unknown protocol "..proto |
305 | end | 306 | end |
306 | end | 307 | end |
307 | 308 | ||
diff --git a/src/luarocks/fetch/hg.lua b/src/luarocks/fetch/hg.lua index 885060a2..5c1575ba 100644 --- a/src/luarocks/fetch/hg.lua +++ b/src/luarocks/fetch/hg.lua | |||
@@ -20,8 +20,7 @@ function get_sources(rockspec, extract, dest_dir) | |||
20 | local hg_cmd = rockspec.variables.HG | 20 | local hg_cmd = rockspec.variables.HG |
21 | local name_version = rockspec.name .. "-" .. rockspec.version | 21 | local name_version = rockspec.name .. "-" .. rockspec.version |
22 | local module = dir.base_name(rockspec.source.url) | 22 | local module = dir.base_name(rockspec.source.url) |
23 | -- Strip off .hg from base name if present | 23 | |
24 | module = module:gsub("%.hg$", "") | ||
25 | local command = {hg_cmd, "clone", "--startrev HEAD", rockspec.source.url, module} | 24 | local command = {hg_cmd, "clone", "--startrev HEAD", rockspec.source.url, module} |
26 | local tag_or_branch = rockspec.source.tag or rockspec.source.branch | 25 | local tag_or_branch = rockspec.source.tag or rockspec.source.branch |
27 | if tag_or_branch then | 26 | if tag_or_branch then |