From 445f1ae80fa64950f1058a62fd4aab1becc80709 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 27 May 2011 16:17:09 -0700 Subject: [PATCH] backtrack_depgraph: display_problems for each run --- pym/_emerge/depgraph.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 8ad054797..de75eb131 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6631,6 +6631,8 @@ def backtrack_depgraph(settings, trees, myopts, myparams, def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, spinner): + debug = "--debug" in myopts + mydepgraph = None max_retries = myopts.get('--backtrack', 10) max_depth = max(1, (max_retries + 1) / 2) allow_backtracking = max_retries > 0 @@ -6641,6 +6643,13 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp myopts, spinner) while backtracker: + + if debug and mydepgraph is not None: + writemsg_level( + "\n\nbacktracking try %s \n\n" % \ + backtracked, noiselevel=-1, level=logging.DEBUG) + mydepgraph.display_problems() + backtrack_parameters = backtracker.get() mydepgraph = depgraph(settings, trees, myopts, myparams, spinner, @@ -6663,10 +6672,11 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp if not (success or mydepgraph.success_without_autounmask()) and backtracked: - if "--debug" in myopts: + if debug: writemsg_level( "\n\nbacktracking aborted after %s tries\n\n" % \ backtracked, noiselevel=-1, level=logging.DEBUG) + mydepgraph.display_problems() mydepgraph = depgraph(settings, trees, myopts, myparams, spinner, frozen_config=frozen_config, @@ -6675,10 +6685,11 @@ def _backtrack_depgraph(settings, trees, myopts, myparams, myaction, myfiles, sp success, favorites = mydepgraph.select_files(myfiles) if not success and mydepgraph.autounmask_breakage_detected(): - if "--debug" in myopts: + if debug: writemsg_level( "\n\nautounmask breakage detected\n\n", noiselevel=-1, level=logging.DEBUG) + mydepgraph.display_problems() myopts["--autounmask"] = "n" mydepgraph = depgraph(settings, trees, myopts, myparams, spinner, frozen_config=frozen_config, allow_backtracking=False) -- 2.26.2