Don't exclude system virtuals from world since they can match multiple old-style...
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Jul 2007 09:20:26 +0000 (09:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Jul 2007 09:20:26 +0000 (09:20 -0000)
svn path=/main/trunk/; revision=7180

pym/emerge/__init__.py

index d5a0b053f2b1fbbc31c06e7a9e20b7ef5f8c9951..dc1df199d0a173ebbbb82166b9211fdb4d8a05aa 100644 (file)
@@ -719,8 +719,16 @@ def create_world_atom(pkg_key, metadata, args_set, sets, portdb):
        if new_world_atom == sets["world"].findAtomForPackage(pkg_key, metadata):
                # Both atoms would be identical, so there's nothing to add.
                return None
-       if not slotted and sets["system"].findAtomForPackage(pkg_key, metadata):
-               return None
+       if not slotted:
+               # 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/"):
+                       # 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
        return new_world_atom
 
 def filter_iuse_defaults(iuse):