Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 828059

Summary: sys-apps/portage: Handling of conflicting package names is counterintuitive
Product: Portage Development Reporter: Michał Górny <mgorny>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/portage/pull/775
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-12-03 07:18:32 UTC
Currently, when:

- multiple packages have different categories and the same name

- but only one of them is installed

then the emerge prefers the one that is installed rather than displaying the conflict.

For example, if I 'emerge zstd':

- if neither of the packages are installed, or both, it will display an ambiguity message

- but if app-arch/zstd is installed, it will try to rebuild it without warning

In my opinion, this behavior is not only confusing but makes very little sense.  After all, how often do users actually want to rebuild or upgrade some individual package manually (vs via @world upgrade)?  I think it's more common for 'emerge zstd' to be used to actually install something new.
Comment 1 Mike Gilbert gentoo-dev 2021-12-03 16:55:52 UTC
It might make sense to check installed packages when performing an unmerge action (emerge --unmerge or emerge --depclean).
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-12-03 17:23:34 UTC
From what I've seen, package matching for uninstall is handled separately.
Comment 3 Larry the Git Cow gentoo-dev 2021-12-04 04:56:35 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=f85f0991a90b17009e02d342c58fb5b066d7b0c9

commit f85f0991a90b17009e02d342c58fb5b066d7b0c9
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2021-12-03 07:27:18 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2021-12-04 04:56:20 +0000

    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 <mgorny@gentoo.org>

 lib/_emerge/depgraph.py | 15 ---------------
 1 file changed, 15 deletions(-)