summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-11 21:17:24 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-11 21:17:24 +0000
commit22448abb82f36bf6d1589949be07a6747fd056bf (patch)
tree0ab3431c2a11a8e2f23bb71834dbe6c5e5cf2985
parent685e5f293a917ca0dd41c892f231bffaaa66910e (diff)
downloadportage-22448abb82f36bf6d1589949be07a6747fd056bf.tar.gz
portage-22448abb82f36bf6d1589949be07a6747fd056bf.tar.bz2
portage-22448abb82f36bf6d1589949be07a6747fd056bf.zip
Bug #137562 - Implement backtracking for missing dependencies. Thanks to
Sebastian Mingramm (few) <s.mingramm@gmx.de> for the initial patch which only needed minor changes. svn path=/main/trunk/; revision=13816
-rw-r--r--pym/_emerge/depgraph.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 910f1fafe..42fb869f3 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -281,6 +281,13 @@ class depgraph(object):
continue
missed_updates[pkg.slot_atom] = \
(pkg, mask_reasons["slot conflict"])
+ elif mask_reasons.get("missing dependency"):
+ if pkg.slot_atom in missed_updates:
+ other_pkg, parent_atoms = missed_updates[pkg.slot_atom]
+ if other_pkg > pkg:
+ continue
+ missed_updates[pkg.slot_atom] = \
+ (pkg, mask_reasons["missing dependency"])
if not missed_updates:
return
@@ -640,6 +647,24 @@ class depgraph(object):
return 1
self._dynamic_config._unsatisfied_deps_for_display.append(
((dep.root, dep.atom), {"myparent":dep.parent}))
+
+ # The parent node should not already be in
+ # runtime_pkg_mask, since that would trigger an
+ # infinite backtracking loop.
+ if self._dynamic_config._allow_backtracking:
+ if dep.parent in self._dynamic_config._runtime_pkg_mask:
+ if "--debug" in self._frozen_config.myopts:
+ writemsg(
+ "!!! backtracking loop detected: %s %s\n" % \
+ (dep.parent,
+ 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
+
return 0
# In some cases, dep_check will return deps that shouldn't
# be proccessed any further, so they are identified and