When pruning the list of parents for the slot collision display, always
authorZac Medico <zmedico@gentoo.org>
Wed, 9 Apr 2008 17:54:24 +0000 (17:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 9 Apr 2008 17:54:24 +0000 (17:54 -0000)
show parents that themselves have been pulled into collision slots, since
those are more relevant that others.

svn path=/main/branches/2.1.2/; revision=9773

bin/emerge

index eab47a44d2dd1c7cc7784f1172d7259415aef83d..dd3f1e7e46d39c8fcf16099007a02956091c901c 100755 (executable)
@@ -1760,16 +1760,25 @@ class depgraph(object):
                                                for parent in parents:
                                                        if isinstance(parent, DependencyArg):
                                                                pruned_list.append(parent)
-                                                               if len(pruned_list) == max_parents:
-                                                                       break
+                                               # Prefer Packages instances that themselves have been
+                                               # pulled into collision slots.
+                                               for parent in parents:
+                                                       if isinstance(parent, Package) and \
+                                                               (parent.slot_atom, parent.root) \
+                                                               in self._slot_collision_info:
+                                                               pruned_list.append(parent)
                                                for parent in parents:
                                                        if not isinstance(parent, DependencyArg):
                                                                pruned_list.append(parent)
-                                                               if len(pruned_list) == max_parents:
+                                                               if len(pruned_list) >= max_parents:
                                                                        break
                                                parents = pruned_list
                                        msg.append(" pulled in by\n")
+                                       shown_parents = set()
                                        for parent in parents:
+                                               if parent in shown_parents:
+                                                       continue
+                                               shown_parents.add(parent)
                                                msg.append(2*indent)
                                                msg.append(str(parent))
                                                msg.append("\n")