autounmask: remove faulty reset_pkg() function
authorZac Medico <zmedico@gentoo.org>
Tue, 19 Mar 2013 18:47:31 +0000 (11:47 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 19 Mar 2013 18:47:31 +0000 (11:47 -0700)
This function did not work as intended, due to the pkg variable being
updated in the wrong scope.

pym/_emerge/depgraph.py

index 326dd68ddb750ccc7c9a4449b2d099bc77badaea..a17398c92cbb9ef1ad2673c7d39c415a87521963 100644 (file)
@@ -4342,15 +4342,12 @@ class depgraph(object):
 
                default_selection = (pkg, existing)
 
-               def reset_pkg(pkg):
+               if self._dynamic_config._autounmask is True:
                        if pkg is not None and \
                                pkg.installed and \
                                not self._want_installed_pkg(pkg):
                                pkg = None
 
-               if self._dynamic_config._autounmask is True:
-                       reset_pkg(pkg)
-
                        # Temporarily reset _need_restart state, in order to
                        # avoid interference as reported in bug #459832.
                        earlier_need_restart = self._dynamic_config._need_restart
@@ -4365,7 +4362,10 @@ class depgraph(object):
                                                        root, atom, onlydeps=onlydeps,
                                                        autounmask_level=autounmask_level)
 
-                                       reset_pkg(pkg)
+                                       if pkg is not None and \
+                                               pkg.installed and \
+                                               not self._want_installed_pkg(pkg):
+                                               pkg = None
 
                                if self._dynamic_config._need_restart:
                                        return None, None