Add a --debug warning message inside _add_pkg in case a potentially infinite
authorZac Medico <zmedico@gentoo.org>
Wed, 8 Jul 2009 22:02:17 +0000 (22:02 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 8 Jul 2009 22:02:17 +0000 (22:02 -0000)
backtracking loop is detected (it should never happen).

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

pym/_emerge/depgraph.py

index 61edea2a8afb11c62e96c4a34c0703a7eaeded49..6689f33e375113edc5ff86cb533541377bed4586 100644 (file)
@@ -758,7 +758,19 @@ class depgraph(object):
                                        return 1
                                else:
                                        # A slot conflict has occurred. 
+                                       # The existing node should not already be in
+                                       # runtime_pkg_mask, since that would trigger an
+                                       # infinite backtracking loop.
                                        if self._dynamic_config._allow_backtracking and \
+                                               existing_node in \
+                                               self._dynamic_config._runtime_pkg_mask:
+                                               if "--debug" in self._frozen_config.myopts:
+                                                       writemsg(
+                                                               "!!! backtracking loop detected: %s %s\n" % \
+                                                               (existing_node,
+                                                               self._dynamic_config._runtime_pkg_mask[
+                                                               existing_node]), noiselevel=-1)
+                                       elif self._dynamic_config._allow_backtracking and \
                                                not self._accept_blocker_conflicts():
                                                self._add_slot_conflict(pkg)
                                                if dep.atom is not None and dep.parent is not None: