From: Zac Medico Date: Sun, 10 Jul 2011 01:26:26 +0000 (-0700) Subject: circular_dependency: fix ridiculously long loop X-Git-Tag: v2.2.0_alpha44~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58766559735c0d643bf1a9e5f2979ec6548fff94;p=portage.git circular_dependency: fix ridiculously long loop The flags from REQUIRED_USE were added to affecting_use, which was not really necessary and was a bad idea because a number of flags in affecting_use affects our number of loops exponentially. This will fix bug #374397 in which the large number of flags in the REQUIRED_USE of dev-lang/php-5.3.6-r1 triggered execution of 2 ^ 45 loops. --- diff --git a/pym/_emerge/resolver/circular_dependency.py b/pym/_emerge/resolver/circular_dependency.py index 994e2022d..cb64962f2 100644 --- a/pym/_emerge/resolver/circular_dependency.py +++ b/pym/_emerge/resolver/circular_dependency.py @@ -138,17 +138,7 @@ class circular_dependency_handler(object): usemask, useforce = self._get_use_mask_and_force(parent) autounmask_changes = self._get_autounmask_changes(parent) untouchable_flags = frozenset(chain(usemask, useforce, autounmask_changes)) - affecting_use.difference_update(untouchable_flags) - - #If any of the flags we're going to touch is in REQUIRED_USE, add all - #other flags in REQUIRED_USE to affecting_use, to not lose any solution. - required_use_flags = get_required_use_flags(parent.metadata["REQUIRED_USE"]) - - if affecting_use.intersection(required_use_flags): - affecting_use.update(required_use_flags) - affecting_use.difference_update(untouchable_flags) - affecting_use = tuple(affecting_use) if not affecting_use: