Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 5662 - Automatic unused library cleaning
Summary: Automatic unused library cleaning
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Daniel Robbins (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-27 20:34 UTC by Nick Nolan
Modified: 2011-10-30 22:21 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 Nick Nolan 2002-07-27 20:34:37 UTC
how about a specififier in each ebuild stating whether or not the ebuild is a
library. Then when emerge clean is executed it checks whether each library is
used or not, if the library is unused then it is removed from the system.
Comment 1 SpanKY gentoo-dev 2002-07-30 17:20:16 UTC
the problem with this is, what if the user writes their own code to utilize a 
library, but no other packages installed by gentoo do ?
or what if the user installs packages to /usr/local that utilize these 
libraries ?

granted the idea is pretty cool, but i think it is really impossible to do in 
practice (without scanning the entire harddrive, doin ldd on all 
executables ... but this of course assumes that the user does not link 
statically and the user does write code in interpreted languages 
(perl/php/python/etc...) that load libraries themselves
Comment 2 Nick Nolan 2002-07-31 21:55:29 UTC
to combat the things not installed by portage problem how about an emerge
parameter that can be used somthing like the following:

emerge depend SDL

creating a false dependancy for SDL and:

emerge undepend SDL

removing that false dependancy
most people who install packages some other method than emerge will probably be
capable of using depend/undepend.
Comment 3 SpanKY gentoo-dev 2002-07-31 22:23:42 UTC
umm, i dont know what you mean by your last comment
'things not installed by portage problem'

are you refering to the `emerge --inject` functionality ?
`emerge --help`:
       inject (-i short option)
              Add a stub entry for a package so that Portage thinks that it's
              installed when it really isn't.  Handy if you roll your own
              packages.  Example:
              emerge inject gentoo-sources-2.4.19
Comment 4 Dave Nellans 2002-08-04 20:12:19 UTC
I agree this functionality is too complex to try and work out now... For a
similar functionality that already exists try dep-clean in the gentoolkit
package... it lists all packages that are not depended on by something else, and
then you have to make the decision which ones can be unmerged safely.  that
moment of human decision is difficult to catagorize as you say everything being
either being a library or a application
Comment 5 Nicholas Jones (RETIRED) gentoo-dev 2002-10-20 04:04:06 UTC
emerge depclean
In portage-2.0.40+
Dangerous if you misuse it... but it does exactly what I think you want.