summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-05-22 20:47:16 +0200
committerZac Medico <zmedico@gentoo.org>2010-05-22 16:54:06 -0700
commit9de5f67676f1b45a4e68830ee3716bbff10a2f00 (patch)
tree6634b9633c2653e6be24f784ba9e4ca65a48ab9b
parent9ba323ca58c1ab47f20b1ca46073e5e938997385 (diff)
downloadportage-9de5f67676f1b45a4e68830ee3716bbff10a2f00.tar.gz
portage-9de5f67676f1b45a4e68830ee3716bbff10a2f00.tar.bz2
portage-9de5f67676f1b45a4e68830ee3716bbff10a2f00.zip
_emerge.depgraph._show_slot_collision_notice(): Improve atom list prunning
-rw-r--r--pym/_emerge/depgraph.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index efc22e8de..c8b460396 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -481,12 +481,18 @@ class depgraph(object):
parent_atoms = self._dynamic_config._parent_atoms.get(node)
if parent_atoms:
pruned_list = set()
- # Prefer conflict atoms over others.
- for parent_atom in parent_atoms:
- if len(pruned_list) >= max_parents:
- break
- if parent_atom in self._dynamic_config._slot_conflict_parent_atoms:
- pruned_list.add(parent_atom)
+ for pkg, atom in parent_atoms:
+ num_matched_slot_atoms = 0
+ atom_set = InternalPackageSet(initial_atoms=(atom,))
+ for other_node in slot_nodes:
+ if other_node == node:
+ continue
+ if atom_set.findAtomForPackage(other_node):
+ num_matched_slot_atoms += 1
+ if num_matched_slot_atoms < len(slot_nodes) - 1:
+ pruned_list.add((pkg, atom))
+ if len(pruned_list) >= max_parents:
+ break
# If this package was pulled in by conflict atoms then
# show those alone since those are the most interesting.