diff options
author | Zac Medico <zmedico@gentoo.org> | 2017-03-20 16:13:42 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2017-03-22 01:58:44 -0700 |
commit | 82bfd91325b052a4c9250a04939641c15b3d2a20 (patch) | |
tree | 2ad5f72ad0ef0540befcd44438e1b5bc6ffdffb7 | |
parent | emerge: fix --use-ebuild-visibility to reject binary packages (bug 612960) (diff) | |
download | portage-82bfd913.tar.gz portage-82bfd913.tar.bz2 portage-82bfd913.zip |
emerge: fix --usepkg when ebuild is not available (bug 613360)
Fix emerge --usepkg to use a binary package when the corresponding
ebuild is not available (and --use-ebuild-visibility is not enabled),
in cases when no other package is available to satisfy the dependency.
This reverts an unintended behavior change from commit
e309323f156528a8a79a1f755e1326e8880346b7.
Fixes: e309323f1565 ("emerge: fix --use-ebuild-visibility to reject binary packages (bug 612960)")
X-Gentoo-bug: 613360
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=613360
Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r-- | pym/_emerge/depgraph.py | 3 | ||||
-rw-r--r-- | pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py | 26 |
2 files changed, 28 insertions, 1 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 543f4dc78..7c9130b38 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -6062,7 +6062,8 @@ class depgraph(object): identical_binary = True break - if not identical_binary and pkg.built: + if (not identical_binary and pkg.built and + (use_ebuild_visibility or matched_packages)): # If the ebuild no longer exists or it's # keywords have been dropped, reject built # instances (installed or binary). diff --git a/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py b/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py index ea65abded..0d01d0696 100644 --- a/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py +++ b/pym/portage/tests/resolver/test_binary_pkg_ebuild_visibility.py @@ -104,6 +104,32 @@ class BinaryPkgEbuildVisibilityTestCase(TestCase): '[binary]app-misc/foo-3', ], ), + + # The default behavior is to enforce ebuild visibility as + # long as a visible package is available to satisfy the + # current atom. In the following test case, ebuild visibility + # is ignored in order to satisfy the =app-misc/foo-3 atom. + ResolverPlaygroundTestCase( + ["=app-misc/foo-3"], + options = { + "--usepkg": True, + }, + success = True, + mergelist = [ + '[binary]app-misc/foo-3', + ], + ), + + # Verify that --use-ebuild-visibility works with --usepkg + # when no other visible package is available. + ResolverPlaygroundTestCase( + ["=app-misc/foo-3"], + options = { + "--use-ebuild-visibility": "y", + "--usepkg": True, + }, + success = False, + ), ) playground = ResolverPlayground(binpkgs=binpkgs, ebuilds=ebuilds, |