Bug#960802: apt: Feature Request: filter regexes from search using -'[regex]'
On Sat, May 16, 2020 at 02:40:12PM -0500, chris wrote:
> Package: apt
> Version: 2.0.2ubuntu0.1
> Severity: wishlist
>
> * I ran 'apt search cura' to look for the package Cura. The command returned several irrelevant packages whose name begins with 'python-'.
> * I ran 'apt search cura -"python"' to see if it would exclude packages whose name contains "python".
> * The command returned an error. I also looked through the apt manpage to see if an equivalent function exists, and I didn't see one.
> * It would be nice to have the ability to filter out certain strings such as "python" or "lib" when searching for packages. This would cut out a lot of scrolling.
>
I'm against introducing more ad-hoc syntax. We're working on patterns which can query all sorts of things,
and has logic combinators, see apt-patterns(7). That said, description searching, and use in search are not
available yet.
There are also various issues with syntax like that:
* - starts a short option (which is why install uses foo- for removal)
* how do I differentiate the regex "-apt" from "not" the regex "apt"
Patterns solve this, but might be a bit more inconvenient
apt search "~ncura !~npython" for searching names
- short for '?and(?name(cura),?not(?name(python))'
Neither solution is intuitive, but at least people know the patterns from
aptitude already :)
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Reply to: