[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about how "aptitude search" is used



On 04/15/2008 09:13 AM, Daniel Burrows wrote:
  Hello list,

  I'd like to get a feel for how people use "aptitude search".

# Background #
One of the things I'd like to implement in an upcoming aptitude
release (probably post-lenny, likely next year) is a significant
overhaul of the UI to the search engine; that is, how searches are
entered and carried out from the interface.

  In the current CLI, "aptitude search blah" searches for packages
whose name contains "blah".  In contrast, "apt-cache search blah"
searches both package names and descriptions.  What I'd really like to
do is a full-text search with approximate matches on the whole package
index that returns packages which might be relevant to "blah", with an
option to sort the results by various relevance metrics.  Of course,
"aptitude search ?name(blah)" will always be available; this is just
about changing the default behavior on bare strings.


I like the current default behavior for bare strings.

# Problem #

  The problem that I see is that aptitude's current behavior is
predictable enough that people might be relying on it in home-grown
scripts.  Changing the semantics of a command underneath a script is
impolite at best and will likely break things.


Correct.

  The alternative if I decide to maintain backwards-compatibility is
to write a second command like "aptitude find" or "aptitude grok" or
what-have-you, or to add some parameters to the "search" command
(something like "--full-search").  In the first case, I get to answer
user questions about the difference between "find" and "search" until
the end of time, while in the second case, I get to answer user
questions about how to search on more than just package names until the
end of time.

  So, I'd really like to just change the default behavior of "search"
when it's given a bare string.  If I were designing the program up-front
this is what I'd do, and I think it's the best end-point.

# Question #

  How many readers of this list are using "aptitude search" as a
subcommand in a script?  Will you be impacted by this change?  Will
anyone else be adversely impacted despite not using it in a script?

    Thanks,
  Daniel



I'm not using it in a script yet, but the default behavior of 'aptitude search' always made more sense to me that the default behavior of 'apt-cache search.' I'm almost always looking for package name substrings, and when I do decide to search within descriptions, I'm not usually concerned with searching on the package names.

Anyway, for those few times when I need to search for a substring in both the package name and description, 'apt-cache search' is always available. Aptitude doesn't need to become a replica of apt-get.


Reply to: