_emerge.depgraph._show_slot_collision_notice(): Improve atom list prunning
authorSebastian Luther <SebastianLuther@gmx.de>
Sat, 22 May 2010 18:47:16 +0000 (20:47 +0200)
committerZac Medico <zmedico@gentoo.org>
Sat, 22 May 2010 23:54:06 +0000 (16:54 -0700)
pym/_emerge/depgraph.py

index efc22e8de02ba75eec64dd3470350ab282f4e277..c8b460396f291248d87c96c8aa7f5a90931a54dc 100644 (file)
@@ -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.