From c1809b0c62bb118157880de56b01174f18c1c18e Mon Sep 17 00:00:00 2001 From: sylvanaar Date: Sat, 20 Aug 2011 20:09:01 -0400 Subject: some additional fixes --- src/luarocks/fetch.lua | 7 ++++--- src/luarocks/fetch/hg.lua | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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) assert(type(dest_dir) == "string" or not dest_dir) local protocol = rockspec.source.protocol - local vccs = rockspec.source.protocol + local vccs = rockspec.source.vccs + local ok, proto - if vccs == nil or ( protocol == "http" or protocol == "https" or protocol == "ftp" or protocol == "file" ) then + if vccs == nil and ( protocol == "http" or protocol == "https" or protocol == "ftp" or protocol == "file" ) then proto = require("luarocks.fetch") else ok, proto = pcall(require, "luarocks.fetch."..vccs or protocol) if not ok then - return nil, "Unknown protocol "..protocol + return nil, "Unknown protocol "..proto end end 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) local hg_cmd = rockspec.variables.HG local name_version = rockspec.name .. "-" .. rockspec.version local module = dir.base_name(rockspec.source.url) - -- Strip off .hg from base name if present - module = module:gsub("%.hg$", "") + local command = {hg_cmd, "clone", "--startrev HEAD", rockspec.source.url, module} local tag_or_branch = rockspec.source.tag or rockspec.source.branch if tag_or_branch then -- cgit v1.2.3-55-g6feb