Fix the CompositDbapi.match() logic wrt "selective" behavior and installed
authorZac Medico <zmedico@gentoo.org>
Sun, 6 Apr 2008 18:54:26 +0000 (18:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 6 Apr 2008 18:54:26 +0000 (18:54 -0000)
packages so that it correctly handles false argument matches due to PROVIDE
when a corresponding new-style virtual exists. (trunk r9729)

svn path=/main/branches/2.1.2/; revision=9730

bin/emerge

index 01cbf8dbc55a7c8fd4677f5ed3bb590710bd0096..a4865d1abe3fe5789cfc019bf01b4fd1bf8ca983 100755 (executable)
@@ -1480,11 +1480,23 @@ class CompositeDbapi(object):
                else:
                        if pkg.installed and "selective" not in self._depgraph.myparams:
                                try:
-                                       if self._depgraph._set_atoms.findAtomForPackage(
-                                               pkg.cpv, pkg.metadata):
-                                               ret = []
+                                       arg = self._depgraph._set_atoms.findAtomForPackage(
+                                               pkg.cpv, pkg.metadata)
                                except portage_exception.InvalidDependString:
-                                       pass
+                                       arg = None
+                                       arg_cp = None
+                               else:
+                                       arg_cp = portage.dep_getkey(arg)
+                               if arg and arg_cp != pkg.cp:
+                                       # If this argument matches via PROVIDE but there is a
+                                       # new-style virtual available, then the argument does
+                                       # not really apply to this package.
+                                       virt_pkg, virt_existing = \
+                                               self._depgraph._select_package(self._root, arg_cp)
+                                       if virt_pkg and virt_pkg.cp == arg_cp:
+                                               arg = None
+                               if arg:
+                                       ret = []
                        if ret is None:
                                self._cpv_tree_map[pkg.cpv] = \
                                        self._depgraph.pkg_tree_map[pkg.type_name]