aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-02-08 10:41:56 -0800
committerZac Medico <zmedico@gentoo.org>2020-02-08 10:48:45 -0800
commit216c52d1ea447fbf06f6ac00e5d771780508601d (patch)
tree0fed7df73d9b7a0e1428ec212aca2ed9f20c9df2
parentphase-helpers.sh: avoid passing an empty root value to portageq (diff)
downloadportage-216c52d1.tar.gz
portage-216c52d1.tar.bz2
portage-216c52d1.zip
dep_zapdeps: prefer choices with all in graph (bug 649622)
Prefer choices where all packages have been pulled into the graph (except for choices that eliminate upgrades). This logic must be consistent between both update and removal (depclean) actions in order to avoid pulling in packages only to have them removed by depclean, as reported in bug 649622 for virtual/w3m. Bug: https://bugs.gentoo.org/649622 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/dep/dep_check.py8
-rw-r--r--lib/portage/tests/resolver/test_or_choices.py9
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/portage/dep/dep_check.py b/lib/portage/dep/dep_check.py
index 8adb92da2..1dd289eec 100644
--- a/lib/portage/dep/dep_check.py
+++ b/lib/portage/dep/dep_check.py
@@ -722,11 +722,9 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None,
# Prefer upgrades.
(has_upgrade and not has_downgrade)
- # For removal actions, prefer choices where all packages
- # have been pulled into the graph, except for choices that
- # eliminate upgrades.
- or (graph_interface and graph_interface.removal_action and
- choice_1.all_in_graph and not choice_2.all_in_graph and
+ # Prefer choices where all packages have been pulled into
+ # the graph, except for choices that eliminate upgrades.
+ or (choice_1.all_in_graph and not choice_2.all_in_graph and
not (has_downgrade and not has_upgrade))
):
# promote choice_1 in front of choice_2
diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
index f1cc75499..5679d0b5b 100644
--- a/lib/portage/tests/resolver/test_or_choices.py
+++ b/lib/portage/tests/resolver/test_or_choices.py
@@ -465,13 +465,13 @@ class OrChoicesTestCase(TestCase):
test_cases = (
- # Test for bug 649622, where virtual/w3m is installed only
+ # Test for bug 649622, where virtual/w3m was pulled in only
# to be removed by the next emerge --depclean.
ResolverPlaygroundTestCase(
['@world'],
options = {'--update': True, '--deep': True},
success = True,
- mergelist = ['virtual/w3m-0']
+ mergelist = []
),
)
@@ -499,7 +499,10 @@ class OrChoicesTestCase(TestCase):
# Test for bug 649622, where virtual/w3m is removed by
# emerge --depclean immediately after it's installed
- # by a world update.
+ # by a world update. Note that removal of virtual/w3m here
+ # is essentially indistinguishable from removal of
+ # dev-util/cmake-bootstrap in the depclean test case for
+ # bug 703440.
ResolverPlaygroundTestCase(
[],
options={'--depclean': True},