diff options
author | Zac Medico <zmedico@gentoo.org> | 2020-03-14 12:59:22 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2020-03-14 13:35:35 -0700 |
commit | 3e7d37b7cec0978363fc99b089bd69caefe1b826 (patch) | |
tree | e064a125c2575f44493cd37f11044c7e950c7b83 /lib/portage | |
parent | man/emerge.1: fix logrotate directory containing elog-save-summary (diff) | |
download | portage-3e7d37b7cec0978363fc99b089bd69caefe1b826.tar.gz portage-3e7d37b7cec0978363fc99b089bd69caefe1b826.tar.bz2 portage-3e7d37b7cec0978363fc99b089bd69caefe1b826.zip |
depgraph: respect --deep=<depth> with --update (bug 712298)
Fix the _wrapped_select_pkg_highest_available_imp method to select an
installed package when appropriate for the current --deep=<depth>
setting, even with --update enabled. This prevents violation of the
current --deep=<depth> setting in cases where an installed package
which satisfies a dependency is masked for any reason.
Bug: https://bugs.gentoo.org/712298
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage')
-rw-r--r-- | lib/portage/tests/resolver/test_depth.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/portage/tests/resolver/test_depth.py b/lib/portage/tests/resolver/test_depth.py index cb1e2dd5d..ea7c803bb 100644 --- a/lib/portage/tests/resolver/test_depth.py +++ b/lib/portage/tests/resolver/test_depth.py @@ -1,4 +1,4 @@ -# Copyright 2011 Gentoo Foundation +# Copyright 2011-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase @@ -9,6 +9,17 @@ class ResolverDepthTestCase(TestCase): def testResolverDepth(self): + profile = { + "package.mask": + ( + # Mask an installed package (for which an update is + # available) in order to test for bug 712298, where + # --update caused --deep=<depth> to be violated for + # such a package. + "<dev-libs/B-2", + ), + } + ebuilds = { "dev-libs/A-1": {"RDEPEND" : "dev-libs/B"}, "dev-libs/A-2": {"RDEPEND" : "dev-libs/B"}, @@ -65,6 +76,9 @@ class ResolverDepthTestCase(TestCase): world = ["dev-libs/A"] test_cases = ( + # Test for bug 712298, where --update caused --deep=<depth> + # to be violated for dependencies that were masked. In this + # case, the installed dev-libs/B-1 dependency is masked. ResolverPlaygroundTestCase( ["dev-libs/A"], options = {"--update": True, "--deep": 0}, @@ -243,7 +257,7 @@ class ResolverDepthTestCase(TestCase): ) playground = ResolverPlayground(ebuilds=ebuilds, installed=installed, - world=world) + profile=profile, world=world) try: for test_case in test_cases: playground.run_TestCase(test_case) |