Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143498 - revdep-rebuild extended regular expressions
Summary: revdep-rebuild extended regular expressions
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Other
: Lowest enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 292766 237964 305793
  Show dependency tree
 
Reported: 2006-08-10 13:45 UTC by Paul B. Henson
Modified: 2010-04-08 14:46 UTC (History)
2 users (show)

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


Attachments
Patch to make --library option use ERE's (revdep-rebuild-library-ere.patch,3.00 KB, patch)
2008-01-29 22:09 UTC, Heath Caldwell (RETIRED)
Details | Diff
revdep-rebuild.extended-regex.patch (revdep-rebuild.extended-regex.patch,853 bytes, patch)
2010-02-05 20:24 UTC, Paul Varner (RETIRED)
Details | Diff
revdep-rebuild.143498.patch (revdep-rebuild.143498.patch,1006 bytes, patch)
2010-03-01 19:16 UTC, Paul Varner (RETIRED)
Details | Diff
revdep-rebuild.143498.patch (revdep-rebuild.143498.patch,993 bytes, patch)
2010-03-01 20:15 UTC, Paul Varner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul B. Henson 2006-08-10 13:45:05 UTC
It would be nice if revdep-rebuild used egrep internally rather than plain grep, so you could use extended regular expressions for specifying the library. In particular, the openldap ebuild tells you to run revdep-rebuild for like six something different libraries, if egrep were used you could just run with --library lib(ldap|lber).* to catch all of them.
Comment 1 Paul B. Henson 2007-12-22 03:42:04 UTC
Well over a year since this was opened, no comments? Bad idea? Good idea, no time to implement? If the former, maybe somebody could flip the bug to WONTFIX and close it so it stops showing up in my list; if the latter, I'd volunteer to implement if somebody was willing to review the patch and incorporate it.

Thanks...
Comment 2 Steve L 2007-12-22 09:27:24 UTC
I think it's a good idea FWTW. You can use the =~ operator in bash for ERE matching, or GNU find has an ERE option iirc, as well as grep -E of course (which is slightly different to egrep.)

If you want help with making a patch, ask in #bash or #friendly-coders on irc.freenode.org, to save on bugspam, then submit it here.
Comment 3 Paul Varner (RETIRED) gentoo-dev 2007-12-26 16:20:36 UTC
(In reply to comment #1)
> I'd volunteer to
> implement if somebody was willing to review the patch and incorporate it.

It's a good idea, just a lack of time on my part. Attach a patch here and we can move forward from there.
Comment 4 Heath Caldwell (RETIRED) gentoo-dev 2008-01-29 22:09:23 UTC
Created attachment 142159 [details, diff]
Patch to make --library option use ERE's

Here is a patch that implements the behavior.
Comment 5 Steve L 2008-10-20 15:49:28 UTC
(In reply to comment #4)
> Here is a patch that implements the behavior.
> 
Looks good to me, nice and simple.

Only /possible/ issue I can see is use of `sed -r' which is a GNUism. I'm not sure how gentoo-alt handles that kind of thing wrt userland=BSD; most likely a custom PATH with GNU toolkit in, which should mean it's not an issue.

Oh one thing: it won't work easily (for an end-user) with directory slashes in the search term. I'm not sure if this matters or not, I'm just mentioning it for thoroughness of review. If it does, I'd change:
expr="/$SONAME_SEARCH/s/^[[:space:]]*([^[:space:]]*).*$/\1/p"
to:
expr="\@$SONAME_SEARCH@s/^[[:space:]]*([^[:space:]]*).*$/\1/p"
..with the caveat in the docs that @ would need to be backslash-escaped should it ever be desired to use a search term containing that char (which strikes me as unlikely. If not any other char could be used.) This is specified in POSIX.
Comment 6 Paul Varner (RETIRED) gentoo-dev 2010-02-05 20:24:44 UTC
Created attachment 218567 [details, diff]
revdep-rebuild.extended-regex.patch

Updated patch for current versions of revdep-rebuild.  If everything tests smooth, this will go into gentoolkit-0.3.0
Comment 7 Paul Varner (RETIRED) gentoo-dev 2010-02-05 20:58:31 UTC
Downgrading from jpeg-8 to jpeg-7 and running revdep-rebuild --library=libjpeg.so.8 and a plain revdep-rebuild showed no problems.  So patch committed to subversion.

$ svn commit -m "Update revdep-rebuild to use extended regular expressions instead of basic regular expressions. (Bug 143498)"
Sending        branches/gentoolkit-0.2.4/ChangeLog
Sending        branches/gentoolkit-0.2.4/src/revdep-rebuild/revdep-rebuild
Sending        trunk/gentoolkit/ChangeLog
Sending        trunk/gentoolkit/bin/revdep-rebuild
Transmitting file data ....
Committed revision 740.
Comment 8 Paul Varner (RETIRED) gentoo-dev 2010-02-19 15:16:13 UTC
Released in gentoolkit-0.3.0_rc9 and gentoolkit-0.2.4.6
Comment 9 George Kranis 2010-03-01 14:57:53 UTC
Is this actually fixed or my regexp is wrong?
for example
revdep-rebuild --library "libdbus-1.so.3|wtf" doesnt find anything
while
revdep-rebuild --library libdbus-1.so.3 does
Comment 10 Paul Varner (RETIRED) gentoo-dev 2010-03-01 16:47:30 UTC
The expression seems to be fine, however, the code needs further work to fully support the or syntax.
Comment 11 Paul Varner (RETIRED) gentoo-dev 2010-03-01 19:16:41 UTC
Created attachment 221655 [details, diff]
revdep-rebuild.143498.patch

Okay, this patch should fix it.  I tested the following and it returned the same packages each time:

revdep-rebuild --library "libdbus-1.so.3" --verbose --pretend --ignore
revdep-rebuild --library "libdbus-1.so.3|wtf" --verbose --pretend --ignore
revdep-rebuild --library "wtf|libdbus-1.so.3" --verbose --pretend --ignore
Comment 12 Paul Varner (RETIRED) gentoo-dev 2010-03-01 19:22:21 UTC
Fix committed to subversion.

$ svn commit -m "Fix extended regular expression support in revdep-rebuild"
Sending        branches/gentoolkit-0.2.4/src/revdep-rebuild/revdep-rebuild
Sending        trunk/gentoolkit/bin/revdep-rebuild
Transmitting file data ..
Committed revision 747.
Comment 13 Paul Varner (RETIRED) gentoo-dev 2010-03-01 20:00:33 UTC
Released in gentoolkit-0.2.4.6-r1.  It will also be included in gentoolkit-0.3.0_rc10 when that is released.
Comment 14 Paul Varner (RETIRED) gentoo-dev 2010-03-01 20:15:14 UTC
Created attachment 221691 [details, diff]
revdep-rebuild.143498.patch

Accidentally attached the first version of the patch which was missing a quotation mark
Comment 15 Paul Varner (RETIRED) gentoo-dev 2010-04-08 14:46:38 UTC
Released in gentoolkit-0.3.0_rc10 and gentoolkit-0.2.4.6.1