public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r12570 - main/trunk/pym/_emerge
@ 2009-02-02 19:19 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-02-02 19:19 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-02-02 19:19:19 +0000 (Mon, 02 Feb 2009)
New Revision: 12570

Modified:
   main/trunk/pym/_emerge/__init__.py
Log:
In depgraph._serialize_tasks(), when separating uninstall nodes from leaf
nodes, do it earlier so that it covers more code paths.


Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py	2009-02-02 06:11:06 UTC (rev 12569)
+++ main/trunk/pym/_emerge/__init__.py	2009-02-02 19:19:19 UTC (rev 12570)
@@ -6898,21 +6898,26 @@
 				for ignore_priority in ignore_priority_soft_range:
 					nodes = get_nodes(ignore_priority=ignore_priority)
 					if nodes:
+						# If there is a mix of uninstall nodes with other
+						# types, save the uninstall nodes for later since
+						# sometimes a merge node will render an uninstall
+						# node unnecessary (due to occupying the same slot),
+						# and we want to avoid executing a separate uninstall
+						# task in that case.
+						if len(nodes) > 1:
+							non_uninstalls = [node for node in nodes \
+								if node.operation != "uninstall"]
+							if non_uninstalls:
+								nodes = non_uninstalls
+							else:
+								nodes = nodes
+
 						if ignore_priority is None and not tree_mode:
 							# Greedily pop all of these nodes since no
 							# relationship has been ignored. This optimization
 							# destroys --tree output, so it's disabled in tree
-							# mode. If there is a mix of merge and uninstall
-							# nodes, save the uninstall nodes for later since
-							# sometimes a merge node will render an install
-							# node unnecessary, and we want to avoid doing a
-							# separate uninstall task in that case.
-							merge_nodes = [node for node in nodes \
-								if node.operation == "merge"]
-							if merge_nodes:
-								selected_nodes = merge_nodes
-							else:
-								selected_nodes = nodes
+							# mode.
+							selected_nodes = nodes
 						else:
 							# For optimal merge order:
 							#  * Only pop one node.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-02 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-02 19:19 [gentoo-commits] portage r12570 - main/trunk/pym/_emerge Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox