diff options
author | Gábor Oszkár Dénes <gaboroszkar@protonmail.com> | 2024-02-14 18:40:24 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-02-23 04:39:26 +0000 |
commit | 92ff02b9189f8350f44e134d538319e4037f3f71 (patch) | |
tree | 10cbb64f516adf8aead9b072cc0d9a9673c39dc7 /lib/_emerge/depgraph.py | |
parent | socks5: Use real asyncio.run (diff) | |
download | gentoo-portage-92ff02b9189f8350f44e134d538319e4037f3f71.tar.xz gentoo-portage-92ff02b9189f8350f44e134d538319e4037f3f71.zip |
emerge: Skip installed packages with emptytree in depgraph selection
Running emerge with emptytree tries to find the best match for every
atom it needs to install. Sometimes the best matches would be
already installed packages (with `operation=nomerge`), but these
packages would be silently skipped with full emptytree installation.
This change makes sure that emerge attempts to install every package.
If the package has unmet requirements, emerge will complain.
Bug: https://bugs.gentoo.org/651018
Signed-off-by: Gábor Oszkár Dénes <gaboroszkar@protonmail.com>
Closes: https://github.com/gentoo/portage/pull/1272
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r-- | lib/_emerge/depgraph.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 70b83ee1f4b4..ea96bd58c420 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -7640,6 +7640,19 @@ class depgraph: continue if ( + empty + and pkg.installed + and not self._frozen_config.excluded_pkgs.findAtomForPackage( + pkg, modified_use=self._pkg_use_enabled(pkg) + ) + ): + # With --emptytree option we assume no packages + # are installed, so we do not select them. + # But we allow installed packages to satisfy dependency requirements + # if they're explicitly excluded, so we allow them to be selected. + continue + + if ( not pkg.installed and self._frozen_config.excluded_pkgs.findAtomForPackage( pkg, modified_use=self._pkg_use_enabled(pkg) |