Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111501 - app-portage/gentoolkit-0.2.1_pre9 breaks some equery b semantics
Summary: app-portage/gentoolkit-0.2.1_pre9 breaks some equery b semantics
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 12:41 UTC by Daniel Gryniewicz (RETIRED)
Modified: 2005-11-11 11:39 UTC (History)
1 user (show)

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


Attachments
equery.111501.patch (equery.111501.patch,806 bytes, patch)
2005-11-04 15:56 UTC, Paul Varner (RETIRED)
Details | Diff
patch (gentoolkit.patch,737 bytes, patch)
2005-11-04 16:07 UTC, Harald van Dijk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Gryniewicz (RETIRED) gentoo-dev 2005-11-04 12:41:43 UTC
In pre8 and earlier, you could say this:

equery b /lib/libfoo.so /usr/lib/libbar.so /etc/blah.conf

and get as output the three packages that owned those files.  As of pre9, this
gives nothing.  This was very useful, because startup and scan overhead for
equery is very big, so running that as three queries would almost triple the run
time.  I've tracked down the change that caused this to this hunk:

--- equery      2005-11-04 15:33:31.000000000 -0500
+++ /usr/bin/equery     2005-11-04 15:36:18.000000000 -0500
@@ -324,9 +324,9 @@
                        if opts["fullRegex"]: 
                                rx = re.compile(q)
                        elif len(q) and q[0] == "/":
-                               rx = re.compile("^" + q + "$")
+                               rx = re.compile("^" + re.escape(q) + "$")
                        else:
-                               rx = re.compile("/" + q + "$")
+                               rx = re.compile("/" + re.escape(q) + "$")
                except:
                        die(2, "The query '" + pp.regexpquery(q) + "' does not
appear to be a valid regular expression")
 

Reverting that from pre9 fixes the problem.  Among other things, this breaks the
scripts used for getting modular X dependencies.
Comment 1 Paul Varner (RETIRED) gentoo-dev 2005-11-04 14:27:14 UTC
Technically that behavior was a bug, but I do see your point.  I'll look into
reverting the fix.
Comment 2 Paul Varner (RETIRED) gentoo-dev 2005-11-04 14:46:41 UTC
With gentoolkit-0.2.1_pre9, equery b -f /lib/libfoo.so /usr/lib/libbar.so
/etc/blah.conf will give the desired results
Comment 3 Paul Varner (RETIRED) gentoo-dev 2005-11-04 15:56:55 UTC
Created attachment 72145 [details, diff]
equery.111501.patch

Okay, my comment about the previous behavior being a bug was incorrect. (I
should have read the code instead of man and help)  Anyhow, that whole section
was actually broken in previous versions as well.  Please test this patch
against gentoolkit-0.2.1_pre9 and verify that it resolves your problems.  If
you have the time please throw some other things at it as well. Try the -f
option for using a regular expressions, giving it bare file names, etc. If it
meets your needs, I will push out a new release.
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2005-11-04 16:07:33 UTC
Created attachment 72146 [details, diff]
patch

Related bug: with _pre8:

$ equery b /lib/libncurses.so /lib/libncursesw.so
[ Searching for file(s) /lib/libncurses.so,/lib/libncursesw.so in *... ]
sys-libs/ncurses-5.5 (/lib/libncurses.so -> libncurses.so.5)
sys-libs/ncurses-5.5 (/lib/libncursesw.so -> libncursesw.so.5)
sys-libs/ncurses-5.5 (/usr/lib/libncursesw.so)
sys-libs/ncurses-5.5 (/lib/libncurses.so.5 -> libncurses.so.5.5)
sys-libs/ncurses-5.5 (/lib/libncurses.so.5.5)

Those last three files shouldn't be listed. It's because equery searches for
^/lib/libncurses\.so|/lib/libncursesw\.so$, but that's interpreted as
(^/lib/libncurses\.so)|(/lib/libncursesw\.so$), instead of
^(/lib/libncurses\.so|/lib/libncursesw\.so)$

This patch (against _pre9) should make equery b file1 file2 search for file1
and file2, and only for file1 and file2; does it look right?
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2005-11-04 16:09:37 UTC
Er... didn't bugzilla have a feature where it would warn when changes were made
to a bug since the page was loaded? I didn't get any such warning... Seems you
fixed it already :)
Comment 6 Paul Varner (RETIRED) gentoo-dev 2005-11-04 17:16:55 UTC
(In reply to comment #4)
> This patch (against _pre9) should make equery b file1 file2 search for file1
> and file2, and only for file1 and file2; does it look right?

I actually prefer your patch as it is more elegant and will use it instead.
Comment 7 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-11-04 20:02:38 UTC
Works great, thanks.  I wouldn't have hit that other bug, because I was giving
full paths to expanded .so files.
Comment 8 Paul Varner (RETIRED) gentoo-dev 2005-11-11 11:39:06 UTC
Fixed in gentoolkit-0.2.1_pre10