Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917119 - sys-apps/portage: uninstall command should indicate ambiguous package names
Summary: sys-apps/portage: uninstall command should indicate ambiguous package names
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-10 12:33 UTC by lexofleviafan
Modified: 2024-07-22 23:56 UTC (History)
3 users (show)

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


Attachments
Patch to add ambiguous package handling to unmerge (0001-lib-Add-ambiguous-package-handling-to-unmerge.patch,3.42 KB, patch)
2024-07-22 21:40 UTC, Joey Pabalinas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lexofleviafan 2023-11-10 12:33:55 UTC
When an ambiguous package is passed to the uninstall command (emerge --unmerge/--depclean), the output is exactly the same as when the package doesn't exist.

Reproducible: Always

Steps to Reproduce:
1.Run an uninstall (depclean or unmerge) command on a term matching multiple fully-qualified installed ebuild names, e.g.:
>$ emerge --ask --depclean man
Actual Results:  
The output describing the error is in the following format:
>--- Couldn't find 'man' to depclean.


Expected Results:  
The output should contain information similar to the output of install command in similar situation; e.g. based on `emerge --quiet man`:
>--- !!! The short ebuild name "man" is ambiguous. Please specify
>--- !!! one of the following fully-qualified ebuild names instead:
>---
>---     acct-group/man
>---     acct-user/man
>---     virtual/man
(Naturally, the output should only contain already installed packages.)
Comment 1 Joey Pabalinas 2024-07-22 21:40:40 UTC
Created attachment 898148 [details, diff]
Patch to add ambiguous package handling to unmerge

Something like this? Maybe there's a better way than search() though...
Comment 2 lexofleviafan 2024-07-22 23:56:10 UTC
>Something like this?

Perhaps?… It's hard to tell for sure without seeing the actual output.

…Though I doubt it makes sense to have two subsequent `if not mymatch:` blocks (especially as the 1st one ends with a `sys.exit()` call)

>Maybe there's a better way than search() though...

I mean, this logic is already implemented elsewhere, so it can probably be reused directly (or failing that, copy-pasted).

P.S. I think I've also seen someone mention that this bug may be limited to _some_ packages (e.g. unmerge cannot match `man` but has no problem matching `git`)