slot collision handler: Prevent excessive running time
authorSebastian Luther <SebastianLuther@gmx.de>
Mon, 11 Oct 2010 16:28:20 +0000 (18:28 +0200)
committerZac Medico <zmedico@gentoo.org>
Mon, 11 Oct 2010 18:11:55 +0000 (11:11 -0700)
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.

pym/_emerge/resolver/slot_collision.py

index 72075259f8d4260168b121725fa12a63b7a931f6..78259a4f0525b7d9cf013b6536a89bda6d55d0de 100644 (file)
@@ -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)