Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828059 - sys-apps/portage: Handling of conflicting package names is counterintuitive
Summary: sys-apps/portage: Handling of conflicting package names is counterintuitive
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-03 07:18 UTC by Michał Górny
Modified: 2021-12-04 04:56 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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(-)