summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-12 09:04:48 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-12 09:04:48 +0000
commit257f75d5a57fd74b262cda6e3f8361cb9a00e2f5 (patch)
treefd3cb3ac56fdfbecbd3e5e05b123293446674a31
parent2f65afdb8c02b5ca619dc351f1af4837946ab32a (diff)
downloadportage-257f75d5a57fd74b262cda6e3f8361cb9a00e2f5.tar.gz
portage-257f75d5a57fd74b262cda6e3f8361cb9a00e2f5.tar.bz2
portage-257f75d5a57fd74b262cda6e3f8361cb9a00e2f5.zip
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
-rw-r--r--pym/_emerge/depgraph.py7
1 files changed, 4 insertions, 3 deletions
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.