Summary: | extend "emerge -s" (fuzzy search, search options) | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Mark <mark.morschhaeuser> |
Component: | Core - Interface (emerge) | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | Keywords: | InVCS |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 604854 |
Description
Mark
2004-09-27 12:18:08 UTC
i feel like everything could be handled with a regexp (which emerge -s supports) 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. 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). There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_65566 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/8994f6f733d4b49a08721526531a7867 Patch updated and posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/43aba739d5f9b629b98f23bd618a6310 https://github.com/gentoo/portage/pull/37 This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b7f0937a811ef4859333ccc45f8076dca109dc2f Fixed in portage-2.3.3. |