1 |
Fix emerge --usepkg to use a binary package when the corresponding |
2 |
ebuild is not available (and --use-ebuild-visibility is not enabled), |
3 |
in cases when no other package is available to satisfy the dependency. |
4 |
This reverts an unintended behavior change from commit |
5 |
e309323f156528a8a79a1f755e1326e8880346b7. |
6 |
|
7 |
Fixes: e309323f1565 ("emerge: fix --use-ebuild-visibility to reject binary packages (bug 612960)") |
8 |
X-Gentoo-bug: 613360 |
9 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=613360 |
10 |
--- |
11 |
[PATCH v2] moves the conditional logic earier, for more backward compatiblity |
12 |
|
13 |
pym/_emerge/depgraph.py | 3 ++- |
14 |
.../resolver/test_binary_pkg_ebuild_visibility.py | 26 ++++++++++++++++++++++ |
15 |
2 files changed, 28 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
18 |
index 543f4dc..7c9130b 100644 |
19 |
--- a/pym/_emerge/depgraph.py |
20 |
+++ b/pym/_emerge/depgraph.py |
21 |
@@ -6062,7 +6062,8 @@ class depgraph(object): |
22 |
identical_binary = True |
23 |
break |
24 |
|
25 |
- if not identical_binary and pkg.built: |
26 |
+ if (not identical_binary and pkg.built and |
27 |
+ (use_ebuild_visibility or matched_packages)): |
28 |
# If the ebuild no longer exists or it's |
29 |
# keywords have been dropped, reject built |
30 |
# instances (installed or binary). |
31 |
diff --git a/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py b/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py |
32 |
index ea65abd..0d01d06 100644 |
33 |
--- a/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py |
34 |
+++ b/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py |
35 |
@@ -104,6 +104,32 @@ class BinaryPkgEbuildVisibilityTestCase(TestCase): |
36 |
'[binary]app-misc/foo-3', |
37 |
], |
38 |
), |
39 |
+ |
40 |
+ # The default behavior is to enforce ebuild visibility as |
41 |
+ # long as a visible package is available to satisfy the |
42 |
+ # current atom. In the following test case, ebuild visibility |
43 |
+ # is ignored in order to satisfy the =app-misc/foo-3 atom. |
44 |
+ ResolverPlaygroundTestCase( |
45 |
+ ["=app-misc/foo-3"], |
46 |
+ options = { |
47 |
+ "--usepkg": True, |
48 |
+ }, |
49 |
+ success = True, |
50 |
+ mergelist = [ |
51 |
+ '[binary]app-misc/foo-3', |
52 |
+ ], |
53 |
+ ), |
54 |
+ |
55 |
+ # Verify that --use-ebuild-visibility works with --usepkg |
56 |
+ # when no other visible package is available. |
57 |
+ ResolverPlaygroundTestCase( |
58 |
+ ["=app-misc/foo-3"], |
59 |
+ options = { |
60 |
+ "--use-ebuild-visibility": "y", |
61 |
+ "--usepkg": True, |
62 |
+ }, |
63 |
+ success = False, |
64 |
+ ), |
65 |
) |
66 |
|
67 |
playground = ResolverPlayground(binpkgs=binpkgs, ebuilds=ebuilds, |
68 |
-- |
69 |
2.10.2 |