diff options
| author | sylvanaar <sylvanaar@mindspring.com> | 2011-08-20 20:09:01 -0400 |
|---|---|---|
| committer | sylvanaar <sylvanaar@mindspring.com> | 2011-08-20 20:09:01 -0400 |
| commit | c1809b0c62bb118157880de56b01174f18c1c18e (patch) | |
| tree | 8351ca83f451ab33b5b03791ff51731aae1c64b0 /src | |
| parent | 3f6df3b29d5e7b4e4bf7d8b9dbe51bd5e2febd7f (diff) | |
| download | luarocks-c1809b0c62bb118157880de56b01174f18c1c18e.tar.gz luarocks-c1809b0c62bb118157880de56b01174f18c1c18e.tar.bz2 luarocks-c1809b0c62bb118157880de56b01174f18c1c18e.zip | |
some additional fixes
Diffstat (limited to 'src')
| -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 |
