When running a command like `emerge --update <package>`, if said package has masked dependencies then emerge will try to update those dependencies to unmasked versions even though it violates (goes deeper) than the current --deep=<depth> (or lack thereof) parameter. This patch to the depgraph _wrapped_select_pkg_highest_available_imp method solves the problem: > diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py > index a8ccd270d..b58ef7271 100644 > --- a/lib/_emerge/depgraph.py > +++ b/lib/_emerge/depgraph.py > @@ -6371,7 +6371,9 @@ class depgraph(object): > cpv = pkg.cpv > reinstall_for_flags = None > > - if not pkg.installed or \ > + if pkg.installed and parent and not self._want_update_pkg(parent, pkg): > + 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
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=3e7d37b7cec0978363fc99b089bd69caefe1b826 commit 3e7d37b7cec0978363fc99b089bd69caefe1b826 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-03-14 19:59:22 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-03-14 20:35:35 +0000 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> lib/_emerge/depgraph.py | 8 ++++++-- lib/portage/tests/resolver/test_depth.py | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=729dc030f6b318f84ca6336c7bd7dddaa7e48040 commit 729dc030f6b318f84ca6336c7bd7dddaa7e48040 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-03-15 01:23:23 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-03-15 01:29:25 +0000 sys-apps/portage: Bump to version 2.3.94 #692492 secure ebuild ${D} permissions #710444 omit zstd --long=31 for decompress on 32-bit arch #712298 respect emerge --deep=<depth> with --update Bug: https://bugs.gentoo.org/711148 Bug: https://bugs.gentoo.org/692492 Bug: https://bugs.gentoo.org/710444 Bug: https://bugs.gentoo.org/712298 Package-Manager: Portage-2.3.94, Repoman-2.3.20 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-2.3.94.ebuild | 271 +++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+)