From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 05829158086 for ; Sat, 4 Dec 2021 04:56:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1126DE07D0; Sat, 4 Dec 2021 04:56:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EF518E07D0 for ; Sat, 4 Dec 2021 04:56:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0CE50342DBB for ; Sat, 4 Dec 2021 04:56:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 476821F2 for ; Sat, 4 Dec 2021 04:56:36 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1638593780.f85f0991a90b17009e02d342c58fb5b066d7b0c9.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: lib/_emerge/depgraph.py X-VCS-Directories: lib/_emerge/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: f85f0991a90b17009e02d342c58fb5b066d7b0c9 X-VCS-Branch: master Date: Sat, 4 Dec 2021 04:56:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5ff82611-13cf-4845-9ca3-e461043924e1 X-Archives-Hash: ac4b650b8d2b84acd0ab3cd589bdd438 commit: f85f0991a90b17009e02d342c58fb5b066d7b0c9 Author: Michał Górny gentoo org> AuthorDate: Fri Dec 3 07:27:18 2021 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Dec 4 04:56:20 2021 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f85f0991 emerge: Do not resolve ambiguous package names via installed pkgs 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 Closes: https://github.com/gentoo/portage/pull/775 Signed-off-by: Michał Górny 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: