Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 375763 - emerge automatically resolves ambiguous package names without warning
Summary: emerge automatically resolves ambiguous package names without warning
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 14:03 UTC by Amadeusz Sławiński
Modified: 2019-11-07 21:41 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 Amadeusz Sławiński 2011-07-20 14:03:59 UTC
After emerge mpc -pv portage suggests only emerging dev-libs/mpc and ignores media-sound/mpc. It should report ambiguous results.

Reproducible: Always

Steps to Reproduce:
1.emerge mpc -pv

Actual Results:  
[ebuild   R    ] dev-libs/mpc-0.9  0 kB

Expected Results:  
Something like with emerge screen -pv but for mpc:
[ Results for search key : screen ]
[ Applications found : 2 ]

*  app-misc/screen
      Latest version available: 4.0.3-r4
      Latest version installed: [ Not Installed ]
      Size of files: 820 kB
      Homepage:      http://www.gnu.org/software/screen/
      Description:   Full-screen window manager that multiplexes physical terminals between several processes
      License:       GPL-2

*  app-vim/screen
      Latest version available: 1.4
      Latest version installed: [ Not Installed ]
      Size of files: 12 kB
      Homepage:      http://www.vim.org/scripts/script.php?script_id=2711
      Description:   vim plugin: simulate a split shell with screen or tmux
      License:       public-domain

!!! The short ebuild name "screen" is ambiguous. Please specify
!!! one of the above fully-qualified ebuild names instead.

... done!


Portage 2.1.10.7 (hardened/linux/amd64/selinux, gcc-4.5.2, glibc-2.13-r4, 2.6.39-hardened-r7 x86_64)
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-07-20 14:59:02 UTC
This is done BY DESIGN.

Once an ambiguous atom is in your world file, then portage will consider that atom when you type it. Otherwise, when there is no ambiguous atom in your world file, portage can't guess which one you meant.

I'm not a portage dev, so I will leave this bug open.
Comment 2 Zac Medico gentoo-dev 2011-07-20 15:11:09 UTC
The automatic resolution of ambiguous names is definitely a feature, but I suppose we could trigger a brief warning message showing ambiguous matches in this case.

You can always use emerge --search if you want a verbose display of ambiguous results.
Comment 3 SpanKY gentoo-dev 2011-07-21 01:06:12 UTC
pretty sure this is by design ... ambiguous atoms default to ones that are installed already
Comment 4 Amadeusz Sławiński 2011-07-21 20:39:08 UTC
dev-libs/mpc is dependency of @system on my machine it is not in world file. It is added after emerge, which probably is ok with design, but I'm not sure if it the best thing to do.
On the other hand while emerging stuff it is rather safe if not entirely expected behaviour, I think bigger problem is when unmerging it may lead to accidental removing of dev-libs/mpc when media-sound/mpc is already uninstalled, which in turn may lead to broken gcc (not sure if this is a case but gcc rdepends on it).
Comment 5 Zac Medico gentoo-dev 2011-07-21 21:19:25 UTC
(In reply to comment #4)
> dev-libs/mpc is dependency of @system on my machine it is not in world file. It
> is added after emerge, which probably is ok with design, but I'm not sure if it
> the best thing to do.

When you don't use --oneshot, it's added to the world file only after the merge succeeds since if it fails for some reason there's not much point in recording it in the world file since it will get recorded once it finally does succeed (if ever).

> On the other hand while emerging stuff it is rather safe if not entirely
> expected behaviour, I think bigger problem is when unmerging it may lead to
> accidental removing of dev-libs/mpc when media-sound/mpc is already
> uninstalled, which in turn may lead to broken gcc (not sure if this is a case
> but gcc rdepends on it).

Well, --unmerge is always a risk. It will bail out if the name is ambiguous among those packages that are actually installed. You can protect yourself by using --ask, and --depclean <atom> will even check reverse dependencies for you (--unmerge already has a warning message which suggests to use --depclean).
Comment 6 Amadeusz Sławiński 2019-11-07 21:41:15 UTC
sys-apps/portage-2.3.78-r2::gentoo seems to tell me if package I want to install/uninstall is ambigious, so I guess this can be closed.