Bug 29240 - pkcon search command should allow regex matching
Summary: pkcon search command should allow regex matching
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Richard Hughes
QA Contact:
Depends on:
Reported: 2010-07-25 03:46 UTC by caramba_bk
Modified: 2018-08-21 15:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description caramba_bk 2010-07-25 03:46:33 UTC
Searching for packages which contain a certain file is a useful feature, but it seems limited in that you need to provide the full installation path, which is hard to guess.
For example `pkcon search file firefox` doesn't return anything, but `pkcon search file /usr/bin/firefox` does return the firefox package.
So would it be possible to allow an optional mode that enables either regex or at least globbing? It would be something like this:
pkcon search file --regex "firefox$"
pkcon search file --glob "**/firefox"
Comment 1 caramba_bk 2010-08-23 13:57:18 UTC
This actually applies to all searches, so changing the summary.
For example searching for the package named "ed" returns a pile of matches, all which contain the substring "ed" in the package name.
If the following option was allowed, results would be better:
$ pkcon search --regex ^ed$
At least apt supports regex searching by default, otherwise pkcon could complain with a not-supported error.
Comment 2 Richard Hughes 2010-08-31 03:14:15 UTC
Searching for single files is allowed in the API, see http://cgit.freedesktop.org/packagekit/tree/src/org.freedesktop.PackageKit.Transaction.xml#n1103 for details. What backend are you using? yum, apt? It's likely these just need supported added.
Comment 3 caramba_bk 2010-09-12 10:04:36 UTC
OK. The backend is yum. As far as the command line is concerned, they seem to support such searches by running `yum provides "*/firefox"` - Note that the */ prefix is needed for matching basenames.

But the problem would remain for `pkcon search` which treats argument as a substring (the "ed" problem). Maybe I should file that as another bug.
Comment 4 Richard Hughes 2018-08-21 15:52:45 UTC
We moved the upstream bugtracker to GitHub a long time ago. If this issue still affects you please re-create the issue here: https://github.com/hughsie/PackageKit/issues
Sorry for the impersonal message, and fingers crossed your issue no longer happens. Thanks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.