Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 292766 - preserve-libs.eclass: preserve_old_lib_notify should coalesce multiple revdep-rebuild calls via regexp syntax
Summary: preserve-libs.eclass: preserve_old_lib_notify should coalesce multiple revdep...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on: 143498
Blocks:
  Show dependency tree
 
Reported: 2009-11-11 09:52 UTC by MAL
Modified: 2018-01-20 12:33 UTC (History)
2 users (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 MAL 2009-11-11 09:52:16 UTC
The ebuild instructs the user to run several instances of revdep-rebuild on its previous libraries after installation, however each call to revdep-rebuild takes a very long time, at least on my fully featured system.

revdep-rebuild --library liblber-2.3.so.0
revdep-rebuild --library libldap-2.3.so.0
revdep-rebuild --library libldap_r-2.3.so.0

Instead, why not use the regex capabilities of revdep-rebuild --library, thus:

revdep-rebuild --library 'lib[lber|ldap|ldap_r]-2.3.so.0'

Only requiring one session of indexing all system libraries and checking their reverse dependencies.

Reproducible: Always

Steps to Reproduce:
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-11-24 05:26:08 UTC
re-assigning since this is actually a problem in the eclass, not the ebuild.
Comment 2 SpanKY gentoo-dev 2009-11-24 17:26:53 UTC
your example regexp is incorrect as it uses lists instead of groups.  i'm also not going to write something that combines multiple common strings.

the revdep-rebuild regexp is also a pita as it's given directly to grep which is not called with -E to enable extended regexps.  which means any groupings are going to need escapes as well as be non-standard.  revdep-rebuild should be upgraded first i think to use -E in the greps.
Comment 3 MAL 2009-11-25 12:09:12 UTC
So to help the Gentoo users in the meantime, how about the following:

revdep-rebuild --library '"-E lib(lber|ldap|ldap_r)+-2.3.so.0"'

No escapes, just sensible quoting.  Double '-E' doesn't hurt, so it's forward compatible.
Comment 4 SpanKY gentoo-dev 2009-11-25 18:03:58 UTC
i doubt that works the way you think it does, but it might be doable
Comment 5 Paul Varner (RETIRED) gentoo-dev 2010-02-05 20:27:36 UTC
Patch to revdep-rebuild to use extended regular expressions is on Bug 143498.  If it tests out okay, it will be in gentoolkit-0.3.0
Comment 6 Robin Bankhead 2010-11-27 13:59:03 UTC
Voted for this as I've often thought along these lines but my regexp knowledge was not up to it.  I'm not clear if SpankY means that handling the data as an enumeration of names followed by a common version-number is the preferred way of handling the data, or the contrary, but certainly the ebuilds for openssl and openldap pass the data to the eclass in that manner.

Either way would be fine as far as I can tell: the eclass certainly knows which three (or however many) files it is dealing with, and at worst you could construct a grep argument that makes a set of all three filenames end-to-end, without sub-setting. I think a lot of folks would appreciate it.
Comment 7 James Broadhead 2011-05-06 11:09:35 UTC
Is it really worthwhile to do this, where a 'vanilla' call to "revdep-rebuild" will catch the libraries anyway, with no cost at the evaluation stage? (on systems with multiple broken library references, people would have to rebuild for them too, but that would be a feature, not a bug).

Telling people just to run "revdep-rebuild" would have the added benefit that if elog told people to run;

> revdep-rebuild --library libfoo-0.2.so
> rm path/libfoo-0.2.so

and then for a different package

> revdep-rebuild --library libbar-0.1.so
> rm path/libbar-0.1.so

They would instead be told to: 
> revdep-rebuild 
> rm path/libfoo-0.2.so
and then for the other package
> revdep-rebuild 
> rm path/libbar-0.1.so

The canny user would run revdep-rebuild once, not twice.
Comment 8 michael@smith-li.com 2011-05-06 12:48:32 UTC
(In reply to comment #7)
> Is it really worthwhile to do this, where a 'vanilla' call to "revdep-rebuild"
> will catch the libraries anyway, with no cost at the evaluation stage?

It would only catch those libraries that are missing. If path/libfoo-0.2.so still exists (as an orphan), revdep-rebuild wont't catch it.

The "efficient", but risky way of doing what you suggest would be to nuke the orphans first, then run revdep-rebuild.

> rm path/libfoo-0.2.so path/libbar-0.1.so
> revdep-rebuild

Most of the time that story ends in a happy ending, but it's still not as safe as leaving the orphans around.

Another fix would be to give revdep-rebuild orphan detection itself, by comparing the list of neededs against qfile -of <(qlist -ao) or the like.

This keeps revdep-rebuild independent of any given package update, and lets them clean up orphans at their leisure.



> systems with multiple broken library references, people would have to rebuild
> for them too, but that would be a feature, not a bug).
> 
> Telling people just to run "revdep-rebuild" would have the added benefit that
> if elog told people to run;
> 
> > revdep-rebuild --library libfoo-0.2.so
> > rm path/libfoo-0.2.so
> 
> and then for a different package
> 
> > revdep-rebuild --library libbar-0.1.so
> > rm path/libbar-0.1.so
> 
> They would instead be told to: 
> > revdep-rebuild 
> > rm path/libfoo-0.2.so
> and then for the other package
> > revdep-rebuild 
> > rm path/libbar-0.1.so
> 
> The canny user would run revdep-rebuild once, not twice.