REQUIRED_USE: no autounmask, so skip backtracking
authorZac Medico <zmedico@gentoo.org>
Thu, 3 Feb 2011 02:03:05 +0000 (18:03 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 3 Feb 2011 02:03:05 +0000 (18:03 -0800)
pym/_emerge/depgraph.py

index 2f8037aa0057d977f1905cb74348e22403c4f2d5..05ca1872eb9378dfee7eea13f027311da59e67b4 100644 (file)
@@ -203,6 +203,9 @@ class _dynamic_depgraph_config(object):
                self._needed_use_config_changes = backtrack_parameters.needed_use_config_changes
                self._runtime_pkg_mask = backtrack_parameters.runtime_pkg_mask
                self._need_restart = False
+               # For conditions that always require user intervention, such as
+               # unsatisfied REQUIRED_USE (currently has no autounmask support).
+               self._skip_restart = False
                self._backtrack_infos = {}
 
                self._autounmask = depgraph._frozen_config.myopts.get('--autounmask', 'n') == True
@@ -840,6 +843,7 @@ class depgraph(object):
                                        atom = Atom("=" + pkg.cpv)
                                self._dynamic_config._unsatisfied_deps_for_display.append(
                                        ((pkg.root, atom), {"myparent":dep.parent}))
+                               self._dynamic_config._skip_restart = True
                                return 0
 
                if not pkg.onlydeps:
@@ -1885,7 +1889,7 @@ class depgraph(object):
                                        if isinstance(arg, PackageArg):
                                                if not self._add_pkg(arg.package, dep) or \
                                                        not self._create_graph():
-                                                       if not self._dynamic_config._need_restart:
+                                                       if not self.need_restart():
                                                                sys.stderr.write(("\n\n!!! Problem " + \
                                                                        "resolving dependencies for %s\n") % \
                                                                        arg.arg)
@@ -1948,7 +1952,7 @@ class depgraph(object):
                                        # so that later dep_check() calls can use it as feedback
                                        # for making more consistent atom selections.
                                        if not self._add_pkg(pkg, dep):
-                                               if self._dynamic_config._need_restart:
+                                               if self.need_restart():
                                                        pass
                                                elif isinstance(arg, SetArg):
                                                        writemsg(("\n\n!!! Problem resolving " + \
@@ -5473,8 +5477,9 @@ class depgraph(object):
                """
 
        def need_restart(self):
-               return self._dynamic_config._need_restart
-       
+               return self._dynamic_config._need_restart and \
+                       not self._dynamic_config._skip_restart
+
        def success_without_autounmask(self):
                return self._dynamic_config._success_without_autounmask