From: Zac Medico Date: Wed, 12 Aug 2009 09:04:48 +0000 (-0000) Subject: Set a limit of 30 backtracking attempts, since it's possible for it to X-Git-Tag: v2.2_rc39~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=257f75d5a57fd74b262cda6e3f8361cb9a00e2f5;p=portage.git Set a limit of 30 backtracking attempts, since it's possible for it to go out of control and take an unreasonable amount of time. svn path=/main/trunk/; revision=14014 --- diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 9010fddfa..fb6c51084 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4949,9 +4949,10 @@ def backtrack_depgraph(settings, trees, myopts, myparams, """ Raises PackageSetNotFound if myfiles contains a missing package set. """ + backtrack_max = 30 runtime_pkg_mask = None allow_backtracking = True - backtracked = False + backtracked = 0 frozen_config = _frozen_depgraph_config(settings, trees, myopts, spinner) while True: @@ -4961,9 +4962,9 @@ def backtrack_depgraph(settings, trees, myopts, myparams, runtime_pkg_mask=runtime_pkg_mask) success, favorites = mydepgraph.select_files(myfiles) if not success: - if mydepgraph.need_restart(): + if mydepgraph.need_restart() and backtracked < backtrack_max: runtime_pkg_mask = mydepgraph.get_runtime_pkg_mask() - backtracked = True + backtracked += 1 elif backtracked and allow_backtracking: # Backtracking failed, so disable it and do # a plain dep calculation + error message.