portdbapi.xmatch: optimize minimum-visible
authorZac Medico <zmedico@gentoo.org>
Sat, 24 Sep 2011 20:58:16 +0000 (13:58 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 24 Sep 2011 20:58:16 +0000 (13:58 -0700)
Also, make repoman cache IUSE, since that's required for _match_use to
work effciently. This will eliminate lots of redundant aux_get calls
for repoman, triggered by USE deps.

bin/repoman
pym/portage/dbapi/porttree.py

index 85c9c1785b9dcd585d059ad9e922daa4e3073775..184c5ef2cd8a00f79c77e557b45c80930a260db3 100755 (executable)
@@ -627,7 +627,7 @@ root_config = RootConfig(repoman_settings, trees[root], None)
 # We really only need to cache the metadata that's necessary for visibility
 # filtering. Anything else can be discarded to reduce memory consumption.
 portdb._aux_cache_keys.clear()
-portdb._aux_cache_keys.update(["EAPI", "KEYWORDS", "SLOT"])
+portdb._aux_cache_keys.update(["EAPI", "IUSE", "KEYWORDS", "SLOT"])
 
 reposplit = myreporoot.split(os.path.sep)
 repolevel = len(reposplit)
index 42e5ca168a0903884fd3303b910308dd2cd2c130..782ceccccb9a0b7a9e37527c87cf00c4c66944e2 100644 (file)
@@ -957,16 +957,10 @@ class portdbapi(dbapi):
                                                mydep.slot != metadata["SLOT"]:
                                                continue
 
-                                       if mydep.use is not None:
-                                               mydep_with_repo = mydep
-                                               if repo is not None and mydep.repo is None:
-                                                       mydep_with_repo = mydep.with_repo(repo)
-                                               has_iuse = False
-                                               for has_iuse in self._iter_match_use(
-                                                       mydep_with_repo, [cpv]):
-                                                       break
-                                               if has_iuse is False:
-                                                       continue
+                                       if mydep.unevaluated_atom.use is not None and \
+                                               not self._match_use(mydep, cpv, metadata):
+                                               continue
+
                                        myval = cpv
                                        break
                                if myval: