In dep_zapdeps(), add a new choice category for choices that have packages
authorZac Medico <zmedico@gentoo.org>
Sat, 30 Aug 2008 06:10:22 +0000 (06:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 30 Aug 2008 06:10:22 +0000 (06:10 -0000)
that aren't yet installed but have been added to the graph. This category
is given lower priority that the category for packages that are already
installed. This helps dep_zapdeps() avoid making choices in some cases that
would result in an unsolvable circular dependency. Thanks to Diego "Flameeyes"
Pettenò for reporting a circular dependency issue involving that java overlay
which is solved by this patch. The particular issue was triggered when
attempting to install dev-java/icedtea6 for the first time. A circular
dependency between dev-java/eclipse-ecj-3.2.2-r1 and dev-java/icedtea6-1.2
occured since icedtea6 was chosen to satisfy the jdk dependency of
eclipse-ecj, even though sun-jdk-1.6.0.07 was already installed and capable of
satisfying the dependency. This patch solves the issue by causing sun-jdk to
be properly selected to satisfy the jdk dependency of eclipse-ecj.

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

pym/portage/__init__.py

index a97f1eec7578467657db427109737952b72c63a7..3bcb0b06c0b5288a439d5942ebc5a4f074ae6a4a 100644 (file)
@@ -6218,6 +6218,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
        # d) is the first item
 
        preferred = []
+       preferred_not_installed = []
        preferred_any_slot = []
        possible_upgrades = []
        other = []
@@ -6298,7 +6299,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                                                break
                                if all_in_graph:
                                        if parent is None:
-                                               preferred.append(this_choice)
+                                               preferred_not_installed.append(this_choice)
                                        else:
                                                # Check if the atom would result in a direct circular
                                                # dependency and try to avoid that if it seems likely
@@ -6318,7 +6319,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                                                                circular_atom = atom
                                                                break
                                                if circular_atom is None:
-                                                       preferred.append(this_choice)
+                                                       preferred_not_installed.append(this_choice)
                                                else:
                                                        other.append(this_choice)
                                else:
@@ -6332,6 +6333,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
        # into || ( highest version ... lowest version ).  We want to prefer the
        # highest all_available version of the new-style virtual when there is a
        # lower all_installed version.
+       preferred.extend(preferred_not_installed)
        preferred.extend(preferred_any_slot)
        preferred.extend(possible_upgrades)
        possible_upgrades = preferred[1:]