Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 77113 - equery does not list packages with a + in the name
Summary: equery does not list packages with a + in the name
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
: 78437 85361 91438 97998 111155 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-07 23:58 UTC by Lars Weiler (RETIRED)
Modified: 2006-01-17 19:16 UTC (History)
5 users (show)

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


Attachments
escape regex-characters and dont make release optional (if supplied) (equery-queryescape.patch,2.16 KB, patch)
2005-03-19 15:53 UTC, Jürgen Hötzel
Details | Diff
escape regex-characters and dont make release optional (if supplied) (equery-queryescape.patch,2.00 KB, patch)
2005-03-20 05:39 UTC, Jürgen Hötzel
Details | Diff
escapes regexps, in "equery belongs" too. (equery.patch,1.91 KB, patch)
2005-05-04 11:24 UTC, Mikko Ruuska
Details | Diff
Patch to escape regular expressions (equery.77113.patch,3.70 KB, patch)
2005-10-11 11:19 UTC, Paul Varner (RETIRED)
Details | Diff
Patch to escape regular expressions (equery.77113.patch,4.19 KB, patch)
2005-10-12 20:09 UTC, Paul Varner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Weiler (RETIRED) gentoo-dev 2005-01-07 23:58:02 UTC
Try out equery list gtk+ or dvd+rw-tools.

With gtk+ it will show all packages that start with gtk.  For dvd+rw-tools it does not output anything.
Comment 1 Paul Varner (RETIRED) gentoo-dev 2005-01-09 07:18:44 UTC
It is due to the regular expression engine. This isn't intuitive, but the way to get the behavior that you are looking for is to prefix each + with \\

For example:
equery list gtk\\+
equery list dvd\\+rw-tools

Comment 2 Lars Weiler (RETIRED) gentoo-dev 2005-01-09 07:47:36 UTC
As this is a user utility, you can't expect they would escape it with a double-\\.  So that should be really changed.
Comment 3 Paul Varner (RETIRED) gentoo-dev 2005-01-09 20:00:24 UTC
I agree with that.  As much as I like regular expressions, I know that most users will be confused by them. Given that, my preference would be for equery to not use reqular expressions by default and have a flag that turns on the use of regular expressions.
Comment 4 Maik Nijhuis 2005-01-18 07:15:25 UTC
*** Bug 78437 has been marked as a duplicate of this bug. ***
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2005-03-16 19:36:26 UTC
*** Bug 85361 has been marked as a duplicate of this bug. ***
Comment 6 Jürgen Hötzel 2005-03-19 15:51:50 UTC
I Just took a look at the the sources and found another problem: It seems that the a supplied release number is just ignored (optional in the regular expression):

# equery.orig list gtk\\+-1.2.10-r10
[ Searching for package 'gtk\+' in all categories among: ]
 * installed packages
[I--] [  ] x11-libs/gtk+-1.2.10-r11 (1)

The supplied version is also used as regular expression.

# equery.orig list gtk\\+-1.....
[ Searching for package 'gtk\+-1.....' in all categories among: ]
 * installed packages
[I--] [  ] x11-libs/gtk+-1.2.10-r11 (1)

Yes: most users will be confused by this behavior.

I suggest to escape the user query (look at my patch, but forgive me any bugs: i just came home tiddly).


J
Comment 7 Jürgen Hötzel 2005-03-19 15:51:50 UTC
I Just took a look at the the sources and found another problem: It seems that the a supplied release number is just ignored (optional in the regular expression):

# equery.orig list gtk\\+-1.2.10-r10
[ Searching for package 'gtk\+' in all categories among: ]
 * installed packages
[I--] [  ] x11-libs/gtk+-1.2.10-r11 (1)

The supplied version is also used as regular expression.

# equery.orig list gtk\\+-1.....
[ Searching for package 'gtk\+-1.....' in all categories among: ]
 * installed packages
[I--] [  ] x11-libs/gtk+-1.2.10-r11 (1)

Yes: most users will be confused by this behavior.

I suggest to escape the user query (look at my patch, but forgive me any bugs: i just came home tiddly).


Jürgen
Comment 8 Jürgen Hötzel 2005-03-19 15:53:18 UTC
Created attachment 53895 [details, diff]
escape regex-characters and dont make release optional (if supplied)
Comment 9 Jürgen Hötzel 2005-03-20 05:39:33 UTC
Created attachment 53927 [details, diff]
escape regex-characters and dont make release optional (if supplied)
Comment 10 Jürgen Hötzel 2005-03-20 05:44:32 UTC
above patch is much cleaner.
Comment 11 Lars Weiler (RETIRED) gentoo-dev 2005-04-19 15:17:02 UTC
@tools-portage-herd: Any suggestions to the patches?
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2005-05-04 07:29:27 UTC
*** Bug 91438 has been marked as a duplicate of this bug. ***
Comment 13 Mikko Ruuska 2005-05-04 11:24:44 UTC
Created attachment 58050 [details, diff]
escapes regexps, in "equery belongs" too.

Well, I got this done before I noticed duplicateness.  Fixed a bit differently
and also fixes similar regexp bug in "equery belongs" functionality.
Comment 14 Paul Varner (RETIRED) gentoo-dev 2005-07-05 10:13:40 UTC
*** Bug 97998 has been marked as a duplicate of this bug. ***
Comment 15 Paul Varner (RETIRED) gentoo-dev 2005-10-11 11:19:53 UTC
Created attachment 70384 [details, diff]
Patch to escape regular expressions
Comment 16 Paul Varner (RETIRED) gentoo-dev 2005-10-11 11:22:57 UTC
Before I commit my changes to Subversion. I would like people to test the patch
that I created against the equery in gentoolkit-0.2.1_pre8. The patch is based
upon J
Comment 17 Paul Varner (RETIRED) gentoo-dev 2005-10-11 11:22:57 UTC
Before I commit my changes to Subversion. I would like people to test the patch
that I created against the equery in gentoolkit-0.2.1_pre8. The patch is based
upon Jürgen's original patch.  If it looks good I will make similar changes to
the equery belongs command and commit.
Comment 18 Maik Nijhuis 2005-10-12 01:49:25 UTC
I found a couple minor issues with the patch:
1. 'equery w libsigc++' and 'equery s libsigc++' show
[ Searching for packages matching libsigc++... ]
while 'equery l libsigc++' shows:
[ Searching for package 'libsigc\+\+' in '.*' among: ]

It would be better to remove the \'s from the equery l output, it suggests the
user can type a regular expression on the command line while he can't ('equery l
libsig' doesn't show any results, while 'equery l libsigc++' does)

2. 'equery l' gives an error message while it should present a help message
(like 'equery k')
Comment 19 Paul Varner (RETIRED) gentoo-dev 2005-10-12 20:09:05 UTC
Created attachment 70524 [details, diff]
Patch to escape regular expressions

Updated patch. 'equery list' is supposed to return a list of all installed
packages.  The original behavior of searching by regex is enabled by 'equery
list -f <regex>' equery belongs will also now escape the query unless you use
'equery belongs -f <regex>'
Comment 20 Paul Varner (RETIRED) gentoo-dev 2005-10-13 15:06:31 UTC
Fix is in subversion
Comment 21 Paul Varner (RETIRED) gentoo-dev 2005-11-01 11:56:39 UTC
*** Bug 111155 has been marked as a duplicate of this bug. ***
Comment 22 Paul Varner (RETIRED) gentoo-dev 2005-11-03 10:01:08 UTC
Reopening, so that it shows up in searches that exclude resolved
Comment 23 Paul Varner (RETIRED) gentoo-dev 2006-01-17 19:16:41 UTC
Fix is in gentoolkit-0.2.1