From 13a249a6c1dc7e43bbe29791d2ad2bb2b42850d6 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 20 Dec 2013 18:48:11 -0200 Subject: Fix regressions caused by #194. Thank you, integrated testing! --- src/luarocks/deps.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 34ef8298..116b4bbb 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua @@ -324,7 +324,7 @@ local function match_dep(dep, blacklist, deps_mode) assert(type(dep) == "table") local versions = cfg.rocks_provided[dep.name] - if not cfg.rocks_provided[dep.name] then + if cfg.rocks_provided[dep.name] then -- provided rocks have higher priority than manifest's rocks versions = { cfg.rocks_provided[dep.name] } else @@ -366,7 +366,7 @@ end -- @param blacklist table or nil: Program versions to not use as valid matches. -- Table where keys are program names and values are tables where keys -- are program versions and values are 'true'. --- @return table, table: A table where keys are dependencies parsed +-- @return table, table, table: A table where keys are dependencies parsed -- in table format and values are tables containing fields 'name' and -- version' representing matches; a table of missing dependencies -- parsed as tables; and a table of "no-upgrade" missing dependencies @@ -378,16 +378,16 @@ function match_deps(rockspec, blacklist, deps_mode) local matched, missing, no_upgrade = {}, {}, {} for _, dep in ipairs(rockspec.dependencies) do - if not cfg.rocks_provided[dep.name] then - local found = match_dep(dep, blacklist and blacklist[dep.name] or nil, deps_mode) - if found then + local found = match_dep(dep, blacklist and blacklist[dep.name] or nil, deps_mode) + if found then + if not cfg.rocks_provided[dep.name] then matched[dep] = found + end + else + if dep.constraints[1] and dep.constraints[1].no_upgrade then + no_upgrade[dep.name] = dep else - if dep.constraints[1] and dep.constraints[1].no_upgrade then - no_upgrade[dep.name] = dep - else - missing[dep.name] = dep - end + missing[dep.name] = dep end end end -- cgit v1.2.3-55-g6feb