Bug #253904 - Add a lookahead mechanism inside
authorZac Medico <zmedico@gentoo.org>
Tue, 17 Feb 2009 23:53:36 +0000 (23:53 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 17 Feb 2009 23:53:36 +0000 (23:53 -0000)
depgraph._dep_check_composite_db._visible() which masks package choices
that are likely to trigger slot conflicts. Thanks to Vlastimil Babka
<caster@g.o> for the suggestion.

svn path=/main/trunk/; revision=12623

pym/_emerge/__init__.py

index e63da7d5e278ba757e7edfe4f8c7e86f43e50cd9..72be73e7c13fe244b2f766f5eba647a29a18e778 100644 (file)
@@ -8897,6 +8897,20 @@ class depgraph(object):
                                                return False
                                except portage.exception.InvalidDependString:
                                        pass
+                       in_graph = self._depgraph._slot_pkg_map[
+                               self._root].get(pkg.slot_atom)
+                       if in_graph is None:
+                               # Mask choices for packages which are not the highest visible
+                               # version within their slot (since they usually trigger slot
+                               # conflicts).
+                               highest_visible, in_graph = self._depgraph._select_package(
+                                       self._root, pkg.slot_atom)
+                               if pkg != highest_visible:
+                                       return False
+                       elif in_graph != pkg:
+                               # Mask choices for packages that would trigger a slot
+                               # conflict with a previously selected package.
+                               return False
                        return True
 
                def _dep_expand(self, atom):