summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-23 11:19:13 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-23 11:19:13 -0700
commit3d07f74a2fb2e0480e126335f6981218f60da824 (patch)
treedf8fce05f775a23e00c582ac224e988019a33ed1
parentf64ce9b20d5db158cd231691da97580595c1f518 (diff)
downloadportage-3d07f74a2fb2e0480e126335f6981218f60da824.tar.gz
portage-3d07f74a2fb2e0480e126335f6981218f60da824.tar.bz2
portage-3d07f74a2fb2e0480e126335f6981218f60da824.zip
portdbapi.xmatch: fix match-all for multi-repo
-rw-r--r--pym/portage/dbapi/porttree.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index eb7e36a96..e3fe9a911 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -853,6 +853,25 @@ class portdbapi(dbapi):
myval = match_from_list(mydep,
self.cp_list(mykey, mytree=mytree))
+ elif level == "match-all":
+ # match *all* visible *and* masked packages
+ if mydep == mykey:
+ myval = self.cp_list(mykey, mytree=mytree)
+ elif mydep.repo is not None or len(self.porttrees) == 1:
+ myval = list(self._iter_match(mydep,
+ self.cp_list(mykey, mytree=mytree)))
+ else:
+ myval = set()
+ # We iterate over self.porttrees, since it's common to
+ # tweak this attribute in order to adjust match behavior.
+ for tree in self.porttrees:
+ repo = self.repositories.get_name_for_location(tree)
+ myval.update(self._iter_match(mydep.with_repo(repo),
+ self.cp_list(mykey, mytree=mytree)))
+ myval = list(myval)
+ if len(myval) > 1:
+ self._cpv_sort_ascending(myval)
+
elif level == "match-visible":
# find all visible matches
if mydep.repo is not None or len(self.porttrees) == 1:
@@ -969,13 +988,6 @@ class portdbapi(dbapi):
myval = list(self._iter_match(mydep, mylist))
- elif level == "match-all":
- #match *all* visible *and* masked packages
- if mydep == mykey:
- myval = self.cp_list(mykey, mytree=mytree)
- else:
- myval = list(self._iter_match(mydep,
- self.cp_list(mykey, mytree=mytree)))
else:
raise AssertionError(
"Invalid level argument: '%s'" % level)