Cache InternalPackageSet in _iter_match_pkgs().
authorZac Medico <zmedico@gentoo.org>
Tue, 5 Oct 2010 01:45:45 +0000 (18:45 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 5 Oct 2010 01:45:45 +0000 (18:45 -0700)
pym/_emerge/depgraph.py

index e65b942b16e48eef89cec0db025f1c0ba4e04b44..d9d0ed7c3fb6e90c2154985d4046cedc2d215e3b 100644 (file)
@@ -2508,6 +2508,8 @@ class depgraph(object):
                                break
 
                if cpv_list:
+                       atom_set = InternalPackageSet(initial_atoms=(atom,),
+                               allow_repo=True, allow_wildcard=True)
                        if atom.repo is None and hasattr(db, "getRepositories"):
                                repo_list = db.getRepositories()
                        else:
@@ -2534,8 +2536,8 @@ class depgraph(object):
                                                # Make sure that cpv from the current repo satisfies the atom.
                                                # This might not be the case if there are several repos with
                                                # the same cpv, but different metadata keys, like SLOT.
-                                               if not InternalPackageSet(initial_atoms=(atom,), allow_repo=True,
-                                                       ).findAtomForPackage(pkg, modified_use=self._pkg_use_enabled(pkg)):
+                                               if not atom_set.findAtomForPackage(pkg,
+                                                       modified_use=self._pkg_use_enabled(pkg)):
                                                        continue
                                                yield pkg