aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/install.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/install.lua')
-rw-r--r--src/luarocks/install.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua
index 0ae163f8..0a779b86 100644
--- a/src/luarocks/install.lua
+++ b/src/luarocks/install.lua
@@ -23,9 +23,10 @@ or a filename of a locally available rock.
23 23
24--- Install a binary rock. 24--- Install a binary rock.
25-- @param rock_file string: local or remote filename of a rock. 25-- @param rock_file string: local or remote filename of a rock.
26-- @param no_deps boolean: true if dependency check needs to be skipped
26-- @return boolean or (nil, string, [string]): True if succeeded or 27-- @return boolean or (nil, string, [string]): True if succeeded or
27-- nil and an error message and an optional error code. 28-- nil and an error message and an optional error code.
28function install_binary_rock(rock_file) 29function install_binary_rock(rock_file, no_deps)
29 assert(type(rock_file) == "string") 30 assert(type(rock_file) == "string")
30 31
31 local name, version, arch = path.parse_name(rock_file) 32 local name, version, arch = path.parse_name(rock_file)
@@ -53,8 +54,12 @@ function install_binary_rock(rock_file)
53 return nil, "Failed loading rockspec for installed package: "..err, errcode 54 return nil, "Failed loading rockspec for installed package: "..err, errcode
54 end 55 end
55 56
56 ok, err, errcode = deps.check_external_deps(rockspec, "install") 57 if no_deps then
57 if err then return nil, err, errcode end 58 util.printerr("Warning: skipping dependency checks.")
59 else
60 ok, err, errcode = deps.check_external_deps(rockspec, "install")
61 if err then return nil, err, errcode end
62 end
58 63
59 -- For compatibility with .rock files built with LuaRocks 1 64 -- For compatibility with .rock files built with LuaRocks 1
60 if not fs.exists(path.rock_manifest_file(name, version)) then 65 if not fs.exists(path.rock_manifest_file(name, version)) then
@@ -62,8 +67,10 @@ function install_binary_rock(rock_file)
62 if err then return nil, err end 67 if err then return nil, err end
63 end 68 end
64 69
65 ok, err, errcode = deps.fulfill_dependencies(rockspec) 70 if not no_deps then
66 if err then return nil, err, errcode end 71 ok, err, errcode = deps.fulfill_dependencies(rockspec)
72 if err then return nil, err, errcode end
73 end
67 74
68 local wrap_bin_scripts = true 75 local wrap_bin_scripts = true
69 if rockspec.deploy and rockspec.deploy.wrap_bin_scripts == false then 76 if rockspec.deploy and rockspec.deploy.wrap_bin_scripts == false then
@@ -121,7 +128,7 @@ function run(...)
121 local build = require("luarocks.build") 128 local build = require("luarocks.build")
122 return build.run(name, flags["local"] and "--local") 129 return build.run(name, flags["local"] and "--local")
123 elseif name:match("%.rock$") then 130 elseif name:match("%.rock$") then
124 return install_binary_rock(name) 131 return install_binary_rock(name, flags["nodeps"])
125 else 132 else
126 local search = require("luarocks.search") 133 local search = require("luarocks.search")
127 local results, err = search.find_suitable_rock(search.make_query(name:lower(), version)) 134 local results, err = search.find_suitable_rock(search.make_query(name:lower(), version))