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