aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgnacio Burgueño <ignaciob@inconcertcc.com>2015-06-18 12:26:38 -0300
committerIgnacio Burgueño <ignaciob@inconcertcc.com>2015-06-18 12:26:38 -0300
commit8d030a06ed62aef4cf0b4648b54b712069a0d3ad (patch)
tree1b7642d66bb60701f69895bc0a18cc6de4364bff /src
parent7fb623cc55b36aa11ab9a67108960c350ebf2688 (diff)
downloadluarocks-8d030a06ed62aef4cf0b4648b54b712069a0d3ad.tar.gz
luarocks-8d030a06ed62aef4cf0b4648b54b712069a0d3ad.tar.bz2
luarocks-8d030a06ed62aef4cf0b4648b54b712069a0d3ad.zip
Checks if tool is installed (svn, cvs, hg)
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fetch/cvs.lua7
-rw-r--r--src/luarocks/fetch/hg.lua6
-rw-r--r--src/luarocks/fetch/svn.lua4
3 files changed, 15 insertions, 2 deletions
diff --git a/src/luarocks/fetch/cvs.lua b/src/luarocks/fetch/cvs.lua
index cc9fd655..fad1ca0d 100644
--- a/src/luarocks/fetch/cvs.lua
+++ b/src/luarocks/fetch/cvs.lua
@@ -20,9 +20,14 @@ function cvs.get_sources(rockspec, extract, dest_dir)
20 assert(type(rockspec) == "table") 20 assert(type(rockspec) == "table")
21 assert(type(dest_dir) == "string" or not dest_dir) 21 assert(type(dest_dir) == "string" or not dest_dir)
22 22
23 local cvs_cmd = rockspec.variables.CVS
24 if not fs.execute_quiet(cvs_cmd, "--version") then
25 return nil, "'"..cvs_cmd.."' program not found. Is CVS installed? You may want to edit variables.CVS"
26 end
27
23 local name_version = rockspec.name .. "-" .. rockspec.version 28 local name_version = rockspec.name .. "-" .. rockspec.version
24 local module = rockspec.source.module or dir.base_name(rockspec.source.url) 29 local module = rockspec.source.module or dir.base_name(rockspec.source.url)
25 local command = {rockspec.variables.CVS, "-d"..rockspec.source.pathname, "export", module} 30 local command = {cvs_cmd, "-d"..rockspec.source.pathname, "export", module}
26 if rockspec.source.tag then 31 if rockspec.source.tag then
27 table.insert(command, 4, "-r") 32 table.insert(command, 4, "-r")
28 table.insert(command, 5, rockspec.source.tag) 33 table.insert(command, 5, rockspec.source.tag)
diff --git a/src/luarocks/fetch/hg.lua b/src/luarocks/fetch/hg.lua
index e736a071..055e3bbe 100644
--- a/src/luarocks/fetch/hg.lua
+++ b/src/luarocks/fetch/hg.lua
@@ -21,9 +21,13 @@ function hg.get_sources(rockspec, extract, dest_dir)
21 assert(type(dest_dir) == "string" or not dest_dir) 21 assert(type(dest_dir) == "string" or not dest_dir)
22 22
23 local hg_cmd = rockspec.variables.HG 23 local hg_cmd = rockspec.variables.HG
24 if not fs.execute_quiet(hg_cmd, "--version") then
25 return nil, "'"..hg_cmd.."' program not found. Is Mercurial installed? You may want to edit variables.HG"
26 end
27
24 local name_version = rockspec.name .. "-" .. rockspec.version 28 local name_version = rockspec.name .. "-" .. rockspec.version
25 -- Strip off special hg:// protocol type 29 -- Strip off special hg:// protocol type
26 local url = rockspec.source.url:gsub("^hg://", "") 30 local url = rockspec.source.url:gsub("^hg://", "")
27 31
28 local module = dir.base_name(url) 32 local module = dir.base_name(url)
29 33
diff --git a/src/luarocks/fetch/svn.lua b/src/luarocks/fetch/svn.lua
index abeacf9a..8fe582f6 100644
--- a/src/luarocks/fetch/svn.lua
+++ b/src/luarocks/fetch/svn.lua
@@ -21,6 +21,10 @@ function svn.get_sources(rockspec, extract, dest_dir)
21 assert(type(dest_dir) == "string" or not dest_dir) 21 assert(type(dest_dir) == "string" or not dest_dir)
22 22
23 local svn_cmd = rockspec.variables.SVN 23 local svn_cmd = rockspec.variables.SVN
24 if not fs.execute_quiet(svn_cmd, "--version") then
25 return nil, "'"..svn_cmd.."' program not found. Is Subversion installed? You may want to edit variables.SVN"
26 end
27
24 local name_version = rockspec.name .. "-" .. rockspec.version 28 local name_version = rockspec.name .. "-" .. rockspec.version
25 local module = rockspec.source.module or dir.base_name(rockspec.source.url) 29 local module = rockspec.source.module or dir.base_name(rockspec.source.url)
26 local url = rockspec.source.url:gsub("^svn://", "") 30 local url = rockspec.source.url:gsub("^svn://", "")