summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-10-11 18:28:20 +0200
committerZac Medico <zmedico@gentoo.org>2010-10-11 11:11:55 -0700
commit7bdfab8c5e3ca4fb7c6c4dd0e97a9f19a087dc4b (patch)
tree635ef767e5bf845e088c20844b988830deb90fb8
parentd196314b88833b27ee95aa29ebd3df20d7dc1df5 (diff)
downloadportage-7bdfab8c5e3ca4fb7c6c4dd0e97a9f19a087dc4b.tar.gz
portage-7bdfab8c5e3ca4fb7c6c4dd0e97a9f19a087dc4b.tar.bz2
portage-7bdfab8c5e3ca4fb7c6c4dd0e97a9f19a087dc4b.zip
slot collision handler: Prevent excessive running time
The number of configurations to check grows exponentially in the number of conflict_pkgs. To prevent excessive running times, only check the "all-ebuild" configuration, if the number of conflict packages is too large.
-rw-r--r--pym/_emerge/resolver/slot_collision.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py
index 72075259f..78259a4f0 100644
--- a/pym/_emerge/resolver/slot_collision.py
+++ b/pym/_emerge/resolver/slot_collision.py
@@ -155,6 +155,15 @@ class slot_conflict_handler(object):
break
first_config = False
+ if len(conflict_pkgs) > 4:
+ # The number of configurations to check grows exponentially in the number of conflict_pkgs.
+ # To prevent excessive running times, only check the "all-ebuild" configuration,
+ # if the number of conflict packages is too large.
+ if self.debug:
+ writemsg("\nAborting search due to excessive number of configurations.\n", noiselevel=-1)
+ break
+
+
def get_conflict(self):
return "".join(self.conflict_msg)