if nodes:
# If there is a mixture of merges and uninstalls,
# do the uninstalls first.
+ good_uninstalls = None
if len(nodes) > 1:
good_uninstalls = []
for node in nodes:
else:
nodes = nodes
- if ignore_priority is None and not tree_mode:
+ if good_uninstalls or len(nodes) == 1 or \
+ (ignore_priority is None and \
+ not asap_nodes 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
# will not produce a leaf node, so avoid it.
# * It's normal for a selected uninstall to be a
# root node, so don't check them for parents.
- for node in nodes:
- if node.operation == "uninstall" or \
- mygraph.parent_nodes(node):
- selected_nodes = [node]
+ if asap_nodes:
+ prefer_asap_parents = (True, False)
+ else:
+ prefer_asap_parents = (False,)
+ for check_asap_parent in prefer_asap_parents:
+ if check_asap_parent:
+ for node in nodes:
+ parents = mygraph.parent_nodes(node,
+ ignore_priority=DepPrioritySatisfiedRange.ignore_soft)
+ if parents and set(parents).intersection(asap_nodes):
+ selected_nodes = [node]
+ break
+ else:
+ for node in nodes:
+ if mygraph.parent_nodes(node):
+ selected_nodes = [node]
+ break
+ if selected_nodes:
break
-
if selected_nodes:
break
"app-misc/some-app-c-1": {
"RDEPEND": "app-misc/circ-buildtime-a app-misc/circ-buildtime-b",
},
+ "app-admin/eselect-python-20100321" : {},
"sys-apps/portage-2.1.9.42" : {
"DEPEND" : "dev-lang/python",
"RDEPEND" : "dev-lang/python",
},
"sys-apps/portage-2.1.9.49" : {
- "DEPEND" : "dev-lang/python",
+ "DEPEND" : "dev-lang/python >=app-admin/eselect-python-20091230",
"RDEPEND" : "dev-lang/python",
},
"dev-lang/python-3.1" : {},
["app-misc/blocker-runtime-hard-a"],
success = False,
mergelist = ['app-misc/blocker-runtime-hard-a-1', '!!app-misc/blocker-runtime-hard-a']),
- # Test that PORTAGE_PACKAGE_ATOM is merged asap.
+ # Test that PORTAGE_PACKAGE_ATOM is merged asap. Optimally,
+ # satisfied deps are always merged after the asap nodes that
+ # depend on them.
ResolverPlaygroundTestCase(
["dev-lang/python", portage.const.PORTAGE_PACKAGE_ATOM],
success = True,
all_permutations = True,
- mergelist = ['sys-apps/portage-2.1.9.49', 'dev-lang/python-3.2']),
+ mergelist = ['app-admin/eselect-python-20100321', 'sys-apps/portage-2.1.9.49', 'dev-lang/python-3.2']),
# Test that OS_HEADERS_PACKAGE_ATOM and LIBC_PACKAGE_ATOM
# are merged asap, in order to account for implicit
# dependencies. See bug #303567.