From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] emerge: Do not resolve ambiguous package names via installed pkgs
Date: Fri, 3 Dec 2021 08:39:17 +0100 [thread overview]
Message-ID: <20211203073917.211156-1-mgorny@gentoo.org> (raw)
When dealing with ambiguous package names on command-line, do not use
installed packages to resolve them. This is counterintuitive
in the best case, and probably the wrong answer most of the time.
After all, if a user calls emerge with a specific package name, it is
quite likely that he intends to install a missing package rather than
rebuild or upgrade an individual package (though the latter can also
happen). Rather than making assumptions that can go wrong, just display
the ambiguity message as usual.
Bug: https://bugs.gentoo.org/828059
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
lib/_emerge/depgraph.py | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 07431c8ee..f6549eba6 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -4806,21 +4806,6 @@ class depgraph:
if len(non_virtual_cps) == 1:
installed_cp_set = non_virtual_cps
- if len(expanded_atoms) > 1 and len(installed_cp_set) == 1:
- installed_cp = next(iter(installed_cp_set))
- for atom in expanded_atoms:
- if atom.cp == installed_cp:
- available = False
- for pkg in self._iter_match_pkgs_any(
- root_config, atom.without_use, onlydeps=onlydeps
- ):
- if not pkg.installed:
- available = True
- break
- if available:
- expanded_atoms = [atom]
- break
-
# If a non-virtual package and one or more virtual packages
# are in expanded_atoms, use the non-virtual package.
if len(expanded_atoms) > 1:
--
2.34.1
reply other threads:[~2021-12-03 7:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211203073917.211156-1-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox