summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-05 18:46:06 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-05 18:46:06 -0700
commit2183277b1bb4c5324eb42e9f60c876b9f05b3b5e (patch)
treeadab7aa2feb28afe824e683e958b6c3874f1dc84
parent046cd5edb520c12799f3a9cdd82dbc40c0f1096f (diff)
downloadportage-2183277b1bb4c5324eb42e9f60c876b9f05b3b5e.tar.gz
portage-2183277b1bb4c5324eb42e9f60c876b9f05b3b5e.tar.bz2
portage-2183277b1bb4c5324eb42e9f60c876b9f05b3b5e.zip
Optimize xmatch match-all-cpv-only for repo deps.
-rw-r--r--pym/portage/dbapi/porttree.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 2d515e07c..4f700b1bd 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -787,13 +787,23 @@ class portdbapi(dbapi):
# match *all* packages, only against the cpv, in order
# to bypass unecessary cache access for things like IUSE
# and SLOT.
- if mydep == mykey:
- # Share cache with match-all/cp_list
- # when the result is the same.
- level = "match-all"
- myval = self.cp_list(mykey)
- else:
- myval = match_from_list(mydep, self.cp_list(mykey))
+ myval = None
+ mytree = None
+ if mydep.repo is not None:
+ mytree = self.treemap.get(mydep.repo)
+ if mytree is None:
+ myval = []
+
+ if myval is None:
+ if mydep == mykey:
+ # Share cache with match-all/cp_list
+ # when the result is the same.
+ level = "match-all"
+ myval = self.cp_list(mykey, mytree=mytree)
+ else:
+ myval = match_from_list(mydep,
+ self.cp_list(mykey, mytree=mytree))
+
elif level == "list-visible":
#a list of all visible packages, not called directly (just by xmatch())
#myval = self.visible(self.cp_list(mykey))