Fix minor issues in the calculation of the number of parents omitted from
authorZac Medico <zmedico@gentoo.org>
Wed, 9 Apr 2008 18:04:29 +0000 (18:04 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 9 Apr 2008 18:04:29 +0000 (18:04 -0000)
the slot collision display. (trunk r9775)

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

bin/emerge

index dd3f1e7e46d39c8fcf16099007a02956091c901c..60799cf66a3891e4a49030394aec0fbedadcad04 100755 (executable)
@@ -1753,7 +1753,6 @@ class depgraph(object):
                                if parents:
                                        omitted_parents = 0
                                        if len(parents) > max_parents:
-                                               omitted_parents = len(parents) - max_parents
                                                pruned_list = []
                                                # When generating the pruned list, prefer instances
                                                # of DependencyArg over instances of Package.
@@ -1768,17 +1767,15 @@ class depgraph(object):
                                                                in self._slot_collision_info:
                                                                pruned_list.append(parent)
                                                for parent in parents:
-                                                       if not isinstance(parent, DependencyArg):
+                                                       if len(pruned_list) >= max_parents:
+                                                               break
+                                                       if not isinstance(parent, DependencyArg) and \
+                                                               parent not in pruned_list:
                                                                pruned_list.append(parent)
-                                                               if len(pruned_list) >= max_parents:
-                                                                       break
+                                               omitted_parents = len(parents) - len(pruned_list)
                                                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")