aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/_emerge/depgraph.py8
-rw-r--r--lib/portage/tests/resolver/test_depth.py18
2 files changed, 22 insertions, 4 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index a8ccd270d..6d1f62178 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
from __future__ import division, print_function, unicode_literals
@@ -6371,7 +6371,11 @@ class depgraph(object):
cpv = pkg.cpv
reinstall_for_flags = None
- if not pkg.installed or \
+ if pkg.installed and parent is not None and not self._want_update_pkg(parent, pkg):
+ # Ensure that --deep=<depth> is respected even when the
+ # installed package is masked and --update is enabled.
+ pass
+ elif not pkg.installed or \
(matched_packages and not avoid_update):
# Only enforce visibility on installed packages
# if there is at least one other visible package
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)