Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 77113
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Portage Utilities Team <tools-portage@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Lars Weiler (RETIRED) <pylon@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
equery-queryescape.patch escape regex-characters and dont make release optional (if supplied) patch Jürgen Hötzel 2005-03-19 15:53 0000 2.16 KB Details | Diff
equery-queryescape.patch escape regex-characters and dont make release optional (if supplied) patch Jürgen Hötzel 2005-03-20 05:39 0000 2.00 KB Details | Diff
equery.patch escapes regexps, in "equery belongs" too. patch Mikko Ruuska 2005-05-04 11:24 0000 1.91 KB Details | Diff
equery.77113.patch Patch to escape regular expressions patch Paul Varner 2005-10-11 11:19 0000 3.70 KB Details | Diff
equery.77113.patch Patch to escape regular expressions patch Paul Varner 2005-10-12 20:09 0000 4.19 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 77113 depends on: Show dependency tree
Bug 77113 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-01-07 23:58 0000
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 From Paul Varner 2005-01-09 07:18:44 0000 -------
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 From Lars Weiler (RETIRED) 2005-01-09 07:47:36 0000 -------
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 From Paul Varner 2005-01-09 20:00:24 0000 -------
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 From Maik Nijhuis 2005-01-18 07:15:25 0000 -------
*** Bug 78437 has been marked as a duplicate of this bug. ***

------- Comment #5 From Marius Mauch (RETIRED) 2005-03-16 19:36:26 0000 -------
*** Bug 85361 has been marked as a duplicate of this bug. ***

------- Comment #6 From Jürgen Hötzel 2005-03-19 15:51:50 0000 -------
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 From Jürgen Hötzel 2005-03-19 15:51:50 0000 -------
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 From Jürgen Hötzel 2005-03-19 15:53:18 0000 -------
Created an attachment (id=53895) [details]
escape regex-characters and dont make release optional (if supplied)

------- Comment #9 From Jürgen Hötzel 2005-03-20 05:39:33 0000 -------
Created an attachment (id=53927) [details]
escape regex-characters and dont make release optional (if supplied)

------- Comment #10 From Jürgen Hötzel 2005-03-20 05:44:32 0000 -------
above patch is much cleaner.

------- Comment #11 From Lars Weiler (RETIRED) 2005-04-19 15:17:02 0000 -------
@tools-portage-herd: Any suggestions to the patches?

------- Comment #12 From Jakub Moc (RETIRED) 2005-05-04 07:29:27 0000 -------
*** Bug 91438 has been marked as a duplicate of this bug. ***

------- Comment #13 From Mikko Ruuska 2005-05-04 11:24:44 0000 -------
Created an attachment (id=58050) [details]
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 From Paul Varner 2005-07-05 10:13:40 0000 -------
*** Bug 97998 has been marked as a duplicate of this bug. ***

------- Comment #15 From Paul Varner 2005-10-11 11:19:53 0000 -------
Created an attachment (id=70384) [details]
Patch to escape regular expressions

------- Comment #16 From Paul Varner 2005-10-11 11:22:57 0000 -------
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 From Paul Varner 2005-10-11 11:22:57 0000 -------
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 From Maik Nijhuis 2005-10-12 01:49:25 0000 -------
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 From Paul Varner 2005-10-12 20:09:05 0000 -------
Created an attachment (id=70524) [details]
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 From Paul Varner 2005-10-13 15:06:31 0000 -------
Fix is in subversion

------- Comment #21 From Paul Varner 2005-11-01 11:56:39 0000 -------
*** Bug 111155 has been marked as a duplicate of this bug. ***

------- Comment #22 From Paul Varner 2005-11-03 10:01:08 0000 -------
Reopening, so that it shows up in searches that exclude resolved

------- Comment #23 From Paul Varner 2006-01-17 19:16:41 0000 -------
Fix is in gentoolkit-0.2.1

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug