aboutsummaryrefslogtreecommitdiff
path: root/src/luarocks/deps.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/deps.lua')
-rw-r--r--src/luarocks/deps.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index d54c30de..08f2debb 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -102,7 +102,7 @@ local function match_dep(dep, get_versions)
102 latest_matching_msg = " (latest matching is " .. latest_vstring .. ")" 102 latest_matching_msg = " (latest matching is " .. latest_vstring .. ")"
103 end 103 end
104 util.printout("Forcing " .. dep.name .. " to pinned version " .. lockversion .. latest_matching_msg) 104 util.printout("Forcing " .. dep.name .. " to pinned version " .. lockversion .. latest_matching_msg)
105 return nil, nil, queries.new(dep.name, lockversion) 105 return nil, nil, queries.new(dep.name, dep.namespace, lockversion)
106 end 106 end
107 107
108 return latest_vstring, locations[latest_vstring], dep, provided 108 return latest_vstring, locations[latest_vstring], dep, provided
@@ -155,11 +155,11 @@ function deps.match_deps(dependencies, rocks_provided, blacklist, deps_mode)
155 return match_all_deps(dependencies, get_versions) 155 return match_all_deps(dependencies, get_versions)
156end 156end
157 157
158local function rock_status(name, get_versions) 158local function rock_status(dep, get_versions)
159 assert(type(name) == "string") 159 assert(dep:type() == "query")
160 assert(type(get_versions) == "function") 160 assert(type(get_versions) == "function")
161 161
162 local installed, _, _, provided = match_dep(queries.new(name), get_versions) 162 local installed, _, _, provided = match_dep(dep, get_versions)
163 local installation_type = provided and "provided by VM" or "installed" 163 local installation_type = provided and "provided by VM" or "installed"
164 return installed and installed.." "..installation_type or "not installed" 164 return installed and installed.." "..installation_type or "not installed"
165end 165end
@@ -197,7 +197,7 @@ function deps.report_missing_dependencies(name, version, dependencies, deps_mode
197 first_missing_dep = false 197 first_missing_dep = false
198 end 198 end
199 199
200 util.printout((" %s (%s)"):format(tostring(dep), rock_status(dep.name, get_versions))) 200 util.printout((" %s (%s)"):format(tostring(dep), rock_status(dep, get_versions)))
201 end 201 end
202 end 202 end
203end 203end
@@ -301,11 +301,12 @@ function deps.fulfill_dependencies(rockspec, depskey, deps_mode, verify, deplock
301 util.printout("Using dependencies pinned in lockfile: " .. filename) 301 util.printout("Using dependencies pinned in lockfile: " .. filename)
302 302
303 local get_versions = prepare_get_versions("none", rocks_provided, depskey) 303 local get_versions = prepare_get_versions("none", rocks_provided, depskey)
304 for dname, dversion in deplocks.each(depskey) do 304 for dnsname, dversion in deplocks.each(depskey) do
305 local dep = queries.new(dname, dversion) 305 local dname, dnamespace = util.split_namespace(dnsname)
306 local dep = queries.new(dname, dnamespace, dversion)
306 307
307 util.printout(("%s %s is pinned to %s (%s)"):format( 308 util.printout(("%s %s is pinned to %s (%s)"):format(
308 name, version, tostring(dep), rock_status(dep.name, get_versions))) 309 name, version, tostring(dep), rock_status(dep, get_versions)))
309 310
310 local ok, err = deps.fulfill_dependency(dep, "none", rocks_provided, verify, depskey) 311 local ok, err = deps.fulfill_dependency(dep, "none", rocks_provided, verify, depskey)
311 if not ok then 312 if not ok then
@@ -331,7 +332,7 @@ function deps.fulfill_dependencies(rockspec, depskey, deps_mode, verify, deplock
331 for _, dep in ipairs(rockspec[depskey]) do 332 for _, dep in ipairs(rockspec[depskey]) do
332 333
333 util.printout(("%s %s depends on %s (%s)"):format( 334 util.printout(("%s %s depends on %s (%s)"):format(
334 name, version, tostring(dep), rock_status(dep.name, get_versions))) 335 name, version, tostring(dep), rock_status(dep, get_versions)))
335 336
336 local ok, found_or_err, _, no_upgrade = deps.fulfill_dependency(dep, deps_mode, rocks_provided, verify, depskey) 337 local ok, found_or_err, _, no_upgrade = deps.fulfill_dependency(dep, deps_mode, rocks_provided, verify, depskey)
337 if ok then 338 if ok then