\fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
use \fB\-\-depclean\fR or \fB\-\-prune\fR.
.TP
+.BR "\-\-unordered-display "
+By default the displayed merge list is sorted using the order in
+which the packages will be merged. When \fB\-\-tree\fR is used together
+with this option, this constraint is removed, hopefully leading to a
+more readable dependency tree.
+.TP
.BR "\-\-update " (\fB\-u\fR)
Updates packages to the best version available, which may not always be the
highest version number due to masking for testing and development.
if self._show_list():
if "--tree" in self.myopts:
- portage.writemsg_stdout("\n" + \
- darkgreen("These are the packages that " + \
- "would be merged, in reverse order:\n\n"))
+ if "--unordered-display" in self.myopts:
+ portage.writemsg_stdout("\n" + \
+ darkgreen("These are the packages that " + \
+ "would be merged:") + "\n\n")
+ else:
+ portage.writemsg_stdout("\n" + \
+ darkgreen("These are the packages that " + \
+ "would be merged, in reverse order:") + "\n\n")
else:
portage.writemsg_stdout("\n" + \
else:
action = "merged"
if "--tree" in myopts and action != "fetched": # Tree doesn't work with fetching
- print()
- print(darkgreen("These are the packages that would be %s, in reverse order:") % action)
+ if "--unordered-display" in myopts:
+ portage.writemsg_stdout("\n" + \
+ darkgreen("These are the packages that " + \
+ "would be %s:" % action) + "\n\n")
+ else:
+ portage.writemsg_stdout("\n" + \
+ darkgreen("These are the packages that " + \
+ "would be %s, in reverse order:" % action) + "\n\n")
print()
else:
print()
for blocker in uninstall_parents:
mygraph.add(upgrade_node, blocker)
+ if "--unordered-display" in self._frozen_config.myopts:
+ display_list = self._unordered_tree_display(mygraph, mylist)
+ else:
+ display_list = self._ordered_tree_display(mygraph, mylist)
+
+ self._prune_tree_display(display_list)
+
+ return display_list
+
+ def _unordered_tree_display(self, mygraph, mylist):
+ display_list = []
+ seen_nodes = set()
+
+ def print_node(node, depth):
+
+ if node in seen_nodes:
+ pass
+ else:
+ seen_nodes.add(node)
+
+ if isinstance(node, Package):
+ display_list.append((node, depth, True))
+ else:
+ depth = -1
+
+ for child_node in mygraph.child_nodes(node):
+ print_node(child_node, depth + 1)
+
+ for root_node in mygraph.root_nodes():
+ print_node(root_node, 0)
+
+ return display_list
+
+ def _ordered_tree_display(self, mygraph, mylist):
depth = 0
shown_edges = set()
tree_nodes = []
tree_nodes = []
add_parents(x, True)
+ return display_list
+
+ def _prune_tree_display(self, display_list):
last_merge_depth = 0
for i in range(len(display_list) - 1, -1, -1):
node, depth, ordered = display_list[i]
depth >= display_list[i+1][1]:
del display_list[i]
- return display_list
-
def display_problems(self):
"""
Display problems with the dependency graph such as slot collisions.
"--searchdesc",
"--skipfirst",
"--tree",
+"--unordered-display",
"--update",
"--verbose",
]