Inside depgraph._dep_expand(), filter use dbapi.cp_list() to filter out
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 03:25:16 +0000 (03:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 03:25:16 +0000 (03:25 -0000)
any results from dbapi.cp_all() that happen to not contain any ebuilds.
Thanks to Jeremy Olexa <darkside@g.o> for reporting. (trunk r12552)

svn path=/main/branches/2.1.6/; revision=12838

pym/_emerge/__init__.py

index e22eced6a7360b29277f7aa05cd6f0e3aff8a3d2..7636e3cdc33bb6743fa1160f0cee66e9a31e0766 100644 (file)
@@ -5163,9 +5163,9 @@ class depgraph(object):
                        atom_without_category, "null"))
                cat, atom_pn = portage.catsplit(null_cp)
 
+               dbs = self._filtered_trees[root_config.root]["dbs"]
                cp_set = set()
-               for db, pkg_type, built, installed, db_keys in \
-                       self._filtered_trees[root_config.root]["dbs"]:
+               for db, pkg_type, built, installed, db_keys in dbs:
                        cp_set.update(db.cp_all())
                for cp in list(cp_set):
                        cat, pn = portage.catsplit(cp)
@@ -5173,6 +5173,13 @@ class depgraph(object):
                                cp_set.discard(cp)
                deps = []
                for cp in cp_set:
+                       have_pkg = False
+                       for db, pkg_type, built, installed, db_keys in dbs:
+                               if db.cp_list(cp):
+                                       have_pkg = True
+                                       break
+                       if not have_pkg:
+                               continue
                        cat, pn = portage.catsplit(cp)
                        deps.append(insert_category_into_atom(
                                atom_without_category, cat))