From: Zac Medico Date: Sat, 2 Mar 2013 00:57:56 +0000 (-0800) Subject: Fix autounmask/sub-slot interference, bug #459832 X-Git-Tag: v2.2.0_alpha164~3 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=dd75365b27460fc5ceea697bfbb7cb2c2ddcc1cf;p=portage.git Fix autounmask/sub-slot interference, bug #459832 --- diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 6f7b673db..7e51d03c5 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3058,6 +3058,10 @@ class depgraph(object): self._dynamic_config._need_restart = True return False, myfavorites + if self.need_restart(): + # want_restart_for_use_change triggers this + return False, myfavorites + # Any failures except those due to autounmask *alone* should return # before this point, since the success_without_autounmask flag that's # set below is reserved for cases where there are *zero* other @@ -4274,19 +4278,27 @@ class depgraph(object): if self._dynamic_config._autounmask is True: reset_pkg(pkg) - for autounmask_level in self._autounmask_levels(): - if pkg is not None: - break + # Temporarily reset _need_restart state, in order to + # avoid interference as reported in bug #459832. + earlier_need_restart = self._dynamic_config._need_restart + self._dynamic_config._need_restart = False + try: + for autounmask_level in self._autounmask_levels(): + if pkg is not None: + break - pkg, existing = \ - self._wrapped_select_pkg_highest_available_imp( - root, atom, onlydeps=onlydeps, - autounmask_level=autounmask_level) + pkg, existing = \ + self._wrapped_select_pkg_highest_available_imp( + root, atom, onlydeps=onlydeps, + autounmask_level=autounmask_level) - reset_pkg(pkg) - - if self._dynamic_config._need_restart: - return None, None + reset_pkg(pkg) + + if self._dynamic_config._need_restart: + return None, None + finally: + if earlier_need_restart: + self._dynamic_config._need_restart = True if pkg is None: # This ensures that we can fall back to an installed package