diff options
author | Alexander Bersenev <bay@hackerdom.ru> | 2014-02-17 17:55:51 +0600 |
---|---|---|
committer | Alexander Bersenev <bay@hackerdom.ru> | 2014-02-17 17:55:51 +0600 |
commit | 5a3f506c9ef1cfd78940b0509f10ef94b4434e29 (patch) | |
tree | 147c35a17a8bcd8ff467bb3063adab623da51fac /portage_with_autodep/pym/_emerge/resolver/slot_collision.py | |
parent | fixed a deadlock (diff) | |
download | autodep-5a3f506c9ef1cfd78940b0509f10ef94b4434e29.tar.gz autodep-5a3f506c9ef1cfd78940b0509f10ef94b4434e29.tar.bz2 autodep-5a3f506c9ef1cfd78940b0509f10ef94b4434e29.zip |
updated portage to 2.2.8-r1
Diffstat (limited to 'portage_with_autodep/pym/_emerge/resolver/slot_collision.py')
-rw-r--r-- | portage_with_autodep/pym/_emerge/resolver/slot_collision.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/portage_with_autodep/pym/_emerge/resolver/slot_collision.py b/portage_with_autodep/pym/_emerge/resolver/slot_collision.py index 0df8f20..a1c8714 100644 --- a/portage_with_autodep/pym/_emerge/resolver/slot_collision.py +++ b/portage_with_autodep/pym/_emerge/resolver/slot_collision.py @@ -1,4 +1,4 @@ -# Copyright 2010-2011 Gentoo Foundation +# Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@ -80,6 +80,8 @@ class slot_conflict_handler(object): the needed USE changes and prepare the message for the user. """ + _check_configuration_max = 1024 + def __init__(self, depgraph): self.depgraph = depgraph self.myopts = depgraph._frozen_config.myopts @@ -244,7 +246,7 @@ class slot_conflict_handler(object): for (slot_atom, root), pkgs \ in self.slot_collision_info.items(): msg.append(str(slot_atom)) - if root != '/': + if root != self.depgraph._frozen_config._running_root.root: msg.append(" for %s" % (root,)) msg.append("\n\n") @@ -663,14 +665,24 @@ class slot_conflict_handler(object): solutions = [] sol_gen = _solution_candidate_generator(all_involved_flags) - while(True): + checked = 0 + while True: candidate = sol_gen.get_candidate() if not candidate: break solution = self._check_solution(config, candidate, all_conflict_atoms_by_slotatom) + checked += 1 if solution: solutions.append(solution) - + + if checked >= self._check_configuration_max: + # TODO: Implement early elimination for candidates that would + # change forced or masked flags, and don't count them here. + if self.debug: + writemsg("\nAborting _check_configuration due to " + "excessive number of candidates.\n", noiselevel=-1) + break + if self.debug: if not solutions: writemsg("No viable solutions. Rejecting configuration.\n", noiselevel=-1) @@ -843,7 +855,7 @@ class slot_conflict_handler(object): #Make sure the changes don't violate REQUIRED_USE for pkg in required_changes: - required_use = pkg.metadata["REQUIRED_USE"] + required_use = pkg.metadata.get("REQUIRED_USE") if not required_use: continue |