When displaying parents of unsolved blockers, reduce noise by pruning packages
authorZac Medico <zmedico@gentoo.org>
Mon, 12 Jan 2009 08:27:18 +0000 (08:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 12 Jan 2009 08:27:18 +0000 (08:27 -0000)
that are only pulled in by other conflict packages. (trunk r12420)

svn path=/main/branches/2.1.6/; revision=12476

pym/_emerge/__init__.py

index bb9dac73f9d7e0dbd47df7b9b984fe2ae42eef94..4f292ea41bc877a116e986ae7ba562329a086839 100644 (file)
@@ -7223,6 +7223,21 @@ class depgraph(object):
                                if parent_atoms:
                                        conflict_pkgs[pkg] = parent_atoms
 
+               if conflict_pkgs:
+                       # Reduce noise by pruning packages that are only
+                       # pulled in by other conflict packages.
+                       pruned_pkgs = set()
+                       for pkg, parent_atoms in conflict_pkgs.iteritems():
+                               relevant_parent = False
+                               for parent, atom in parent_atoms:
+                                       if parent not in conflict_pkgs:
+                                               relevant_parent = True
+                                               break
+                               if not relevant_parent:
+                                       pruned_pkgs.add(pkg)
+                       for pkg in pruned_pkgs:
+                               del conflict_pkgs[pkg]
+
                if conflict_pkgs:
                        msg = []
                        msg.append("\n")