For unsatisfied USE dependencies, do not backtrack if only USE have to change
authorZac Medico <zmedico@gentoo.org>
Thu, 16 Jul 2009 22:18:45 +0000 (22:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 16 Jul 2009 22:18:45 +0000 (22:18 -0000)
in order to be satisfied. Thanks to Thomas Sachau <tommy@gentoo.org> fo
reporting.

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

pym/_emerge/depgraph.py

index c1b7899660e66071efad00dd4f3b3f2e10d3f77a..22aa904ee7d37cd046d891ebbdf6d85e33e85861 100644 (file)
@@ -664,10 +664,22 @@ class depgraph(object):
                                                        self._dynamic_config._runtime_pkg_mask[
                                                        dep.parent]), noiselevel=-1)
                                else:
-                                       self._dynamic_config._runtime_pkg_mask.setdefault(
-                                               dep.parent, {})["missing dependency"] = \
-                                                       set([(dep.parent, dep.atom)])
-                                       self._dynamic_config._need_restart = True
+                                       # Do not backtrack if only USE have to be changed in
+                                       # order to satisfy the dependency.
+                                       atom_without_use = dep.atom
+                                       if dep.atom.use:
+                                               atom_without_use = portage.dep.remove_slot(dep.atom)
+                                               if dep.atom.slot:
+                                                       atom_without_use += ":" + dep.atom.slot
+                                               atom_without_use = portage.dep.Atom(atom_without_use)
+                                       dep_pkg, existing_node = \
+                                               self._select_package(dep.root, atom_without_use,
+                                                       onlydeps=dep.onlydeps)
+                                       if dep_pkg is None:
+                                               self._dynamic_config._runtime_pkg_mask.setdefault(
+                                                       dep.parent, {})["missing dependency"] = \
+                                                               set([(dep.parent, dep.atom)])
+                                               self._dynamic_config._need_restart = True
 
                        return 0
                # In some cases, dep_check will return deps that shouldn't