From f698437a8038c9c1cc0ce4ce753f63af533cc0ce Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 23 Sep 2020 12:39:49 -0300 Subject: manif: keep scanning on non-default trees --- src/luarocks/core/manif.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/luarocks/core/manif.lua b/src/luarocks/core/manif.lua index 1e9da75e..fe0a95fa 100644 --- a/src/luarocks/core/manif.lua +++ b/src/luarocks/core/manif.lua @@ -91,22 +91,22 @@ function manif.scan_dependencies(name, version, tree_manifests, dest) if manifest.dependencies and manifest.dependencies[name] then pkgdeps = manifest.dependencies[name][version] end - if not pkgdeps then - return nil - end - for _, dep in ipairs(pkgdeps) do - local pkg, constraints = dep.name, dep.constraints - - for _, t in ipairs(tree_manifests) do - local entries = t.manifest.repository[pkg] - if entries then - for ver, _ in util.sortedpairs(entries, vers.compare_versions) do - if (not constraints) or vers.match_constraints(vers.parse_version(ver), constraints) then - manif.scan_dependencies(pkg, ver, tree_manifests, dest) + if pkgdeps then + for _, dep in ipairs(pkgdeps) do + local pkg, constraints = dep.name, dep.constraints + + for _, t in ipairs(tree_manifests) do + local entries = t.manifest.repository[pkg] + if entries then + for ver, _ in util.sortedpairs(entries, vers.compare_versions) do + if (not constraints) or vers.match_constraints(vers.parse_version(ver), constraints) then + manif.scan_dependencies(pkg, ver, tree_manifests, dest) + end end end end end + return end end end -- cgit v1.2.3-55-g6feb