Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269831 - app-portage/gentoolkit-0.3.0_rc5 equery lists broken
Summary: app-portage/gentoolkit-0.3.0_rc5 equery lists broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 269071
  Show dependency tree
 
Reported: 2009-05-14 12:38 UTC by Yar Odin
Modified: 2010-01-14 22:17 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yar Odin 2009-05-14 12:38:35 UTC
Consider man:
Examples:
equery list zilla - list all installed versions of packages containing the string 'zilla'

But
<root@home:~> equery list zilla
 * Searching for zilla ...
 * installed packages:
<root@home:~> 

<root@home:~> equery list mozilla-firefox
 * Searching for mozilla-firefox ...
 * installed packages:
[I--] [  ] www-client/mozilla-firefox-3.0.10 (0)



Reproducible: Always
Comment 1 Douglas Anderson 2009-05-15 04:17:42 UTC
equery list isn't broken, the man page is inaccurate. The small parts of equery's functionality have changed, and unfortunately those changes aren't reflected in the man page yet. See bug 269071. In the meantime, equery list --help should contain enough information to properly use it.

In this case, equery now allows package name globbing, so you can do:
$ equery list '*zilla*'
to replicate the old "fuzzy matching" behavior, but can do a lot more complex searches with it:
$ equery list 'app-*/?vim*'
 * Searching for ?vim* in app-* ...
 * installed packages:
[I--] [  ] app-editors/gvim-7.2 (0)

@ tools-portage: Maybe gentoolkit-0.3 should be masked until the we (I) have time to update the docs?

Comment 2 Paul Varner (RETIRED) gentoo-dev 2009-05-18 22:19:23 UTC
I prefer not to mask gentoolkit-0.3.0 since it won't get widespread use if we mask it and I haven't come across anything that I would consider a major bug.  I have added an ewarn to the gentoolkit-0.3.0_rc6 ebuild stating that the documentation is out of date and to please check bug 269071 when filing bugs to see if the issue is being addressed.
Comment 3 Paul Varner (RETIRED) gentoo-dev 2009-06-19 17:13:48 UTC
Released in gentoolkit-0.3.0_rc7
Comment 4 Paul Varner (RETIRED) gentoo-dev 2009-06-19 17:47:34 UTC
Reopening, since this was not fixed in rc7
Comment 5 Duncan 2009-08-14 19:31:55 UTC
As of gentoolkit-0.3.0_rc7, there's another breakage as well.  If you want this as a different bug, say so and I'll make it so, but the summary here is vague enough to encompass this breakage as well, so...

First, using equery's own inline help, since we already know the manpage, etc, isn't up to date.

$ equery l --help
List installed packages matching the query pattern

!!! [snip]

Usage: list [options] pkgspec

options
[snip]
 -f, --full-regex        query is a regular expression
[snip]
$

So -f should do a regular expression.  However, I can't get it to work that way.  Picking gcc as an example of something I know I have installed:

$ equery l gcc
 * Searching for gcc ...
[IP-] [ ~] sys-devel/gcc-4.4.1 (4.4)
$ equery l -f 'gc.*'
 * Searching for gc.* ...
$ 

OK, so while I've used single-quotes so the shell shouldn't be interfering, maybe whatever regex parsing equery is using needs either the . or * or both escaped...

$ equery l -f 'gc\.*'
 * Searching for gc\.* ...
$ equery l -f 'gc\.\*'
 * Searching for gc\.\* ...
$ equery l -f 'gc.\*'
 * Searching for gc.\* ...
$

OK, so what sort of regex search /is/ this?  What do I do to get it to search for the regex gc.* , that is, gc<anything>, which should certainly return at /least/ gcc and gcc-config, regardless of whether it's implied left-anchored or not, that is, ^gc.* or .*gc.*?

Hmm... looks like it /does/ left-anchor, AND counts the category:

$ equery l -f '.*gc.*'
 * Searching for .*gc.* ...
[IP-] [  ] dev-libs/libgcrypt-1.4.4 (0)
[IP-] [  ] dev-util/pkgconfig-0.23 (0)
[IP-] [ ~] kde-base/kjumpingcube-4.3.0 (4.3)
[IP-] [ ~] sys-devel/gcc-4.4.1 (4.4)
[IP-] [  ] sys-devel/gcc-config-1.4.1 (0)
$ equery l -f '.*/gc.*'
 * Searching for .*/gc.* ...
[IP-] [ ~] sys-devel/gcc-4.4.1 (4.4)
[IP-] [  ] sys-devel/gcc-config-1.4.1 (0)
$

OK, that makes sense, but it's sure not very intuitive, particularly since the default search works fine /without/ the category.  (That would also make the manpage example for --full-regex invalid, but we already know the manpage isn't updated.  However, it does point out another change from the old behavior, one that should IMO be reverted, as left-anchoring regex is somewhat obscure as it is, let alone doing that AND including the category, so regex search on just the un-categoried package-name itself returns nothing at all.  As I said, that's incredibly unintuitive, especially since it splits from the default no-option behavior of matching just the un-categoried package-name just fine.)
Comment 6 Douglas Anderson 2009-08-14 20:35:47 UTC
(In reply to comment #5)

dja@vault gentoolkit $ svn diff helpers2.py
Index: helpers2.py
===================================================================
--- helpers2.py (revision 16)
+++ helpers2.py (working copy)
@@ -150,7 +150,7 @@
 
        # Post-filter
        if query_opts["isRegex"]:
-               predicate = lambda x: re.match(query, x)
+               predicate = lambda x: re.search(query, x)
        else:
                if cat:
                        query_re = fnmatch.translate(query)
dja@vault gentoolkit $ svn ci -m "Change equery list --full-regex behavior from match to search for more intuitive and backwards compatible (but slightly slower) Operation. Thanks to Duncan, comment #5, bug #269831 for reporting."
Sending        gentoolkit/helpers2.py
Transmitting file data .
Committed revision 19.

These changes aren't live in Gentoo's svn repo yet, if you want to check them out before they're pulled in officially, see: http://code.google.com/p/genscripts/source/checkout
Comment 7 Paul Varner (RETIRED) gentoo-dev 2010-01-07 16:21:53 UTC
Still not working intuitively in gentoolkit-0.3.0_rc8

# equery list gcc
 * Searching for gcc ...
[IP-] [  ] sys-devel/gcc-4.3.4 (4.3)
# equery list -f 'gc.*'
 * Searching for gc.* ...
# equery list -f '.*/gc.*'
 * Searching for .*/gc.* ...
[IP-] [ ~] dev-python/gconf-python-2.28.0 (2)
[IP-] [ ~] gnome-base/gconf-2.28.0-r1 (2)
[IP-] [ ~] gnome-extra/gcalctool-5.28.2 (0)
[IP-] [ ~] gnome-extra/gconf-editor-2.28.0 (0)
[IP-] [  ] sys-devel/gcc-4.3.4 (4.3)
[IP-] [ ~] sys-devel/gcc-config-1.4.1 (0)
[IP-] [  ] x11-misc/gccmakedep-1.0.2 (0)
Comment 8 Douglas Anderson 2010-01-14 22:17:50 UTC
(In reply to comment #7)
> Still not working intuitively in gentoolkit-0.3.0_rc8
> 
> # equery list gcc
>  * Searching for gcc ...
> [IP-] [  ] sys-devel/gcc-4.3.4 (4.3)
> # equery list -f 'gc.*'
>  * Searching for gc.* ...
> # equery list -f '.*/gc.*'
>  * Searching for .*/gc.* ...
> [IP-] [ ~] dev-python/gconf-python-2.28.0 (2)
> [IP-] [ ~] gnome-base/gconf-2.28.0-r1 (2)
> [IP-] [ ~] gnome-extra/gcalctool-5.28.2 (0)
> [IP-] [ ~] gnome-extra/gconf-editor-2.28.0 (0)
> [IP-] [  ] sys-devel/gcc-4.3.4 (4.3)
> [IP-] [ ~] sys-devel/gcc-config-1.4.1 (0)
> [IP-] [  ] x11-misc/gccmakedep-1.0.2 (0)
> 

Paul, by the formatting of the slots, it looks like you were still using rc7. It looks fine to me using rc8-r1.

# equery -q l gentoolkit
app-portage/gentoolkit-0.3.0_rc8-r1
# equery l -f 'gc.*'
 * Searching for gc.* ...
[IP-] [  ] dev-libs/libgcrypt-1.4.4:0
[IP-] [  ] dev-libs/libsigc++-2.2.3:2
[IP-] [  ] dev-python/gconf-python-2.26.1:2
[IP-] [  ] dev-util/pkgconfig-0.23:0
[IP-] [  ] gnome-base/gconf-2.26.2-r1:2
[IP-] [  ] gnome-extra/gcalctool-5.26.3:0
[IP-] [  ] gnome-extra/gconf-editor-2.26.0:0
[IP-] [  ] media-plugins/gst-plugins-gconf-0.10.16:0.10
[IP-] [  ] sys-apps/pkgcore-0.5.9:0
[IP-] [  ] sys-devel/gcc-4.3.4:4.3
[IP-] [  ] sys-devel/gcc-config-1.4.1:0
# equery l -f '.*/gc.*'
 * Searching for .*/gc.* ...
[IP-] [  ] dev-python/gconf-python-2.26.1:2
[IP-] [  ] gnome-base/gconf-2.26.2-r1:2
[IP-] [  ] gnome-extra/gcalctool-5.26.3:0
[IP-] [  ] gnome-extra/gconf-editor-2.26.0:0
[IP-] [  ] sys-devel/gcc-4.3.4:4.3
[IP-] [  ] sys-devel/gcc-config-1.4.1:0