Specs for saving old shared libs

Michel Talon talon at lpthe.jussieu.fr
Fri May 18 14:39:24 UTC 2007


Benjamin Lutz wrote:

> > Benjamin Lutz writes:
> > >  The last part seems to be the catch here. How about providing a
> > >  tool that scans all binaries in the standard locations for what
> > >  libs they depend on, and also allows the user/admin to specify
> > >  the paths to binaries that he installed on his own, then outputs
> > >  a list of unused libraries?
> >
> >       Are you aware of "libchk" and "portsclean"?
> 
> Oh. No, I wasn't. Well, I guess that solves this problem then :)

Not completely because some programs install shared libraries in very
non standard places, notably perl installs perl.so like this:
/usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
or mozilla installs mozilla libs in another strange place. And there are
other ports which make use of such shared libraries, for example Gnome
depends on the mozilla libs or inn depends on perl.so.

Hence the only correct solution is to scan all files in a port, and 
determine if any of them is a shared library to keep a copy of it. This
is what portupgrade does, as well as Cyrille Szymanski's pkg_save:
http://www.lpthe.jussieu.fr/~talon/pkg_save.py

The important point is: what do you do with shared libraries you have 
saved? Either you put them in /usr/local/lib/compat like portupgrade
does, and you run ldconfig here, then there is no problem with these
libraries but you have no real way to discover which are necessary,
which are not (libchk cannot assert that since it looks only in standard
places) or you can say like portmaster, i don't want to rely on 
this mechanism, you keep your copy and use it only in case some library
is really missing and you don't know how to solve the problem in another
way.



-- 

Michel TALON



More information about the freebsd-ports mailing list