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 |
pym/_emerge/depgraph.py | 5 +++-- |
12 |
.../resolver/test_binary_pkg_ebuild_visibility.py | 26 ++++++++++++++++++++++ |
13 |
2 files changed, 29 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
16 |
index 543f4dc..b1dae25 100644 |
17 |
--- a/pym/_emerge/depgraph.py |
18 |
+++ b/pym/_emerge/depgraph.py |
19 |
@@ -6072,8 +6072,9 @@ class depgraph(object): |
20 |
if not use_ebuild_visibility and (usepkgonly or useoldpkg): |
21 |
if pkg.installed and pkg.masks: |
22 |
continue |
23 |
- elif not self._equiv_ebuild_visible(pkg, |
24 |
- autounmask_level=autounmask_level): |
25 |
+ elif ((use_ebuild_visibility or matched_packages) |
26 |
+ and not self._equiv_ebuild_visible(pkg, |
27 |
+ autounmask_level=autounmask_level)): |
28 |
continue |
29 |
|
30 |
# Calculation of USE for unbuilt ebuilds is relatively |
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 |