Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 250020
Collapse All | Expand All

(-)pym/_emerge/__init__.py (-30 / +30 lines)
Lines 6898-6934 Link Here
6898
				for ignore_priority in ignore_priority_soft_range:
6898
				for ignore_priority in ignore_priority_soft_range:
6899
					nodes = get_nodes(ignore_priority=ignore_priority)
6899
					nodes = get_nodes(ignore_priority=ignore_priority)
6900
					if nodes:
6900
					if nodes:
6901
						break
6901
						if ignore_priority is None and not tree_mode:
6902
				if nodes:
6902
							# Greedily pop all of these nodes since no
6903
					if ignore_priority is None and not tree_mode:
6903
							# relationship has been ignored. This optimization
6904
						# Greedily pop all of these nodes since no relationship
6904
							# destroys --tree output, so it's disabled in tree
6905
						# has been ignored.  This optimization destroys --tree
6905
							# mode. If there is a mix of merge and uninstall
6906
						# output, so it's disabled in reversed mode. If there
6906
							# nodes, save the uninstall nodes for later since
6907
						# is a mix of merge and uninstall nodes, save the
6907
							# sometimes a merge node will render an install
6908
						# uninstall nodes from later since sometimes a merge
6908
							# node unnecessary, and we want to avoid doing a
6909
						# node will render an install node unnecessary, and
6909
							# separate uninstall task in that case.
6910
						# we want to avoid doing a separate uninstall task in
6910
							merge_nodes = [node for node in nodes \
6911
						# that case.
6911
								if node.operation == "merge"]
6912
						merge_nodes = [node for node in nodes \
6912
							if merge_nodes:
6913
							if node.operation == "merge"]
6913
								selected_nodes = merge_nodes
6914
						if merge_nodes:
6914
							else:
6915
							selected_nodes = merge_nodes
6915
								selected_nodes = nodes
6916
						else:
6916
						else:
6917
							selected_nodes = nodes
6917
							# For optimal merge order:
6918
					else:
6918
							#  * Only pop one node.
6919
						# For optimal merge order:
6919
							#  * Removing a root node (node without a parent)
6920
						#  * Only pop one node.
6920
							#    will not produce a leaf node, so avoid it.
6921
						#  * Removing a root node (node without a parent)
6921
							for node in nodes:
6922
						#    will not produce a leaf node, so avoid it.
6922
								if mygraph.parent_nodes(node):
6923
						for node in nodes:
6923
									# found a non-root node
6924
							if mygraph.parent_nodes(node):
6924
									selected_nodes = [node]
6925
								# found a non-root node
6925
									break
6926
								selected_nodes = [node]
6926
							if not selected_nodes and \
6927
								break
6927
								(accept_root_node or ignore_priority is None):
6928
						if not selected_nodes and \
6928
								# settle for a root node
6929
							(accept_root_node or ignore_priority is None):
6929
								selected_nodes = [nodes[0]]
6930
							# settle for a root node
6930
						if selected_nodes:
6931
							selected_nodes = [nodes[0]]
6931
							break
6932
6932
6933
			if not selected_nodes:
6933
			if not selected_nodes:
6934
				nodes = get_nodes(ignore_priority=DepPriority.MEDIUM)
6934
				nodes = get_nodes(ignore_priority=DepPriority.MEDIUM)

Return to bug 250020