1 |
commit: 216c52d1ea447fbf06f6ac00e5d771780508601d |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 8 18:41:56 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 8 18:48:45 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=216c52d1 |
7 |
|
8 |
dep_zapdeps: prefer choices with all in graph (bug 649622) |
9 |
|
10 |
Prefer choices where all packages have been pulled into the |
11 |
graph (except for choices that eliminate upgrades). This |
12 |
logic must be consistent between both update and removal |
13 |
(depclean) actions in order to avoid pulling in packages |
14 |
only to have them removed by depclean, as reported in |
15 |
bug 649622 for virtual/w3m. |
16 |
|
17 |
Bug: https://bugs.gentoo.org/649622 |
18 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
19 |
|
20 |
lib/portage/dep/dep_check.py | 8 +++----- |
21 |
lib/portage/tests/resolver/test_or_choices.py | 9 ++++++--- |
22 |
2 files changed, 9 insertions(+), 8 deletions(-) |
23 |
|
24 |
diff --git a/lib/portage/dep/dep_check.py b/lib/portage/dep/dep_check.py |
25 |
index 8adb92da2..1dd289eec 100644 |
26 |
--- a/lib/portage/dep/dep_check.py |
27 |
+++ b/lib/portage/dep/dep_check.py |
28 |
@@ -722,11 +722,9 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None, |
29 |
# Prefer upgrades. |
30 |
(has_upgrade and not has_downgrade) |
31 |
|
32 |
- # For removal actions, prefer choices where all packages |
33 |
- # have been pulled into the graph, except for choices that |
34 |
- # eliminate upgrades. |
35 |
- or (graph_interface and graph_interface.removal_action and |
36 |
- choice_1.all_in_graph and not choice_2.all_in_graph and |
37 |
+ # Prefer choices where all packages have been pulled into |
38 |
+ # the graph, except for choices that eliminate upgrades. |
39 |
+ or (choice_1.all_in_graph and not choice_2.all_in_graph and |
40 |
not (has_downgrade and not has_upgrade)) |
41 |
): |
42 |
# promote choice_1 in front of choice_2 |
43 |
|
44 |
diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py |
45 |
index f1cc75499..5679d0b5b 100644 |
46 |
--- a/lib/portage/tests/resolver/test_or_choices.py |
47 |
+++ b/lib/portage/tests/resolver/test_or_choices.py |
48 |
@@ -465,13 +465,13 @@ class OrChoicesTestCase(TestCase): |
49 |
|
50 |
test_cases = ( |
51 |
|
52 |
- # Test for bug 649622, where virtual/w3m is installed only |
53 |
+ # Test for bug 649622, where virtual/w3m was pulled in only |
54 |
# to be removed by the next emerge --depclean. |
55 |
ResolverPlaygroundTestCase( |
56 |
['@world'], |
57 |
options = {'--update': True, '--deep': True}, |
58 |
success = True, |
59 |
- mergelist = ['virtual/w3m-0'] |
60 |
+ mergelist = [] |
61 |
), |
62 |
|
63 |
) |
64 |
@@ -499,7 +499,10 @@ class OrChoicesTestCase(TestCase): |
65 |
|
66 |
# Test for bug 649622, where virtual/w3m is removed by |
67 |
# emerge --depclean immediately after it's installed |
68 |
- # by a world update. |
69 |
+ # by a world update. Note that removal of virtual/w3m here |
70 |
+ # is essentially indistinguishable from removal of |
71 |
+ # dev-util/cmake-bootstrap in the depclean test case for |
72 |
+ # bug 703440. |
73 |
ResolverPlaygroundTestCase( |
74 |
[], |
75 |
options={'--depclean': True}, |