Allow system virtuals to be pruned from the world file in cases where the matched...
authorZac Medico <zmedico@gentoo.org>
Sun, 8 Jul 2007 04:09:51 +0000 (04:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 8 Jul 2007 04:09:51 +0000 (04:09 -0000)
svn path=/main/trunk/; revision=7197

pym/emerge/__init__.py

index 9eaacec1f433e53c164fd1eb47928ee280b88957..e48e6c0853a720f28b55dc95cd85b9065d2eb1fa 100644 (file)
@@ -725,12 +725,16 @@ def create_world_atom(pkg_key, metadata, args_set, sets, portdb):
                # Unlike world atoms, system atoms are not greedy for slots, so they
                # can't be safely excluded from world if they are slotted.
                system_atom = sets["system"].findAtomForPackage(pkg_key, metadata)
-               if system_atom and \
-                       not portage.dep_getkey(system_atom).startswith("virtual/"):
+               if system_atom:
+                       if not portage.dep_getkey(system_atom).startswith("virtual/"):
+                               return None
                        # System virtuals aren't safe to exclude from world since they can
                        # match multiple old-style virtuals but only one of them will be
                        # pulled in by update or depclean.
-                       return None
+                       providers = portdb.mysettings.getvirtuals().get(
+                               portage.dep_getkey(system_atom))
+                       if providers and len(providers) == 1 and providers[0] == cp:
+                               return None
        return new_world_atom
 
 def filter_iuse_defaults(iuse):