Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65566 - extend "emerge -s" (fuzzy search, search options)
Summary: extend "emerge -s" (fuzzy search, search options)
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 604854
  Show dependency tree
Reported: 2004-09-27 12:18 UTC by Mark
Modified: 2017-02-10 18:45 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2004-09-27 12:18:08 UTC
It would be great to have a fuzzy search in emerge because when you search a program and don't know it's exact name, you cannot find it with emerge.
Example: maybe you want to find "gkrellkam" but don't know it's name, so you're searching for gkrellm and cam and both searches will not find it.
The only way is a manual search in x11-plugins.

Furtheron it would be nice to have AND+OR+NOT+ONLY search-parameters like:
emerge -s gettext NOT ruby
emerge -s http ONLY perl
Comment 1 SpanKY gentoo-dev 2004-09-27 20:40:04 UTC
i feel like everything could be handled with a regexp (which emerge -s supports)
Comment 2 Zac Medico gentoo-dev 2016-04-03 23:45:08 UTC
I'd like to implement this. We've already got fuzzy package name search build into the ambiguous package name response, using difflib.

(In reply to SpanKY from comment #1)
> i feel like everything could be handled with a regexp (which emerge -s
> supports)

In comparison, fuzzy search is effortless for users.
Comment 3 Zac Medico gentoo-dev 2016-04-04 01:09:10 UTC
Using the difflib.get_close_matches function as an example, we can use the SequenceMatcher.ratio() method to measure how similar a package name is to the given search string. We can have options to specify cutoff ratio and maximum number of close matches to return. If a maximum number of matches is specified, it is not be possible to display fuzzy results incrementally, though exact matches can still be displayed incrementally (bug 412471).
Comment 4 Zac Medico gentoo-dev 2016-04-04 05:06:32 UTC
There's a patch in the following branch:

I've posted it for review here:
Comment 7 Zac Medico gentoo-dev 2017-02-10 18:45:50 UTC
Fixed in portage-2.3.3.