Ensure that _select_pkg_highest_available_imp() falls back to an
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Aug 2010 05:04:25 +0000 (22:04 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Aug 2010 05:04:25 +0000 (22:04 -0700)
installed package if the autounmask path fails to select something.

pym/_emerge/depgraph.py

index c05679561383be0e53998b11a6b548a031247971..e0e215cf2f9a1b68aeba05b8a50a90558a76b7ca 100644 (file)
@@ -2530,6 +2530,8 @@ class depgraph(object):
        def _select_pkg_highest_available_imp(self, root, atom, onlydeps=False):
                pkg, existing = self._wrapped_select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps)
 
+               default_selection = (pkg, existing)
+
                if self._dynamic_config._autounmask is True:
                        if pkg is not None and \
                                pkg.installed and \
@@ -2556,6 +2558,11 @@ class depgraph(object):
                        if self._dynamic_config._need_restart:
                                return None, None
 
+               if pkg is None:
+                       # This ensures that we can fall back to an installed package
+                       # that may have been rejected in the autounmask path above.
+                       return default_selection
+
                return pkg, existing
 
        def _pkg_visibility_check(self, pkg, allow_unstable_keywords=False):