Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
Date: Thu, 22 Oct 2009 14:14:35
Message-Id: 200910221613.29734.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree by "Jesús Guerrero"
1 On Thursday 22 October 2009 15:58:17 Jesús Guerrero wrote:
2 > > depclean only removes packages that it knows for a fact are no longer
3 > > needed.
4 > > This means
5 > >
6 > > - not in world
7 > > - not linked to by anything
8 > > - not depended on by anything
9 > >
10 > > "not in the tree" is not part of that list. If you have a package in
11 >
12 > world
13 >
14 > > that is not in the tree anymore, depclean will leave it as is. It will
15 > > remove
16 > > ancient mere deps that are somehow still lying around though
17 >
18 > Yep, if the package is in world, delclean will not help.
19 >
20 > You could always do it the bash way. I have no idea if there's any tool
21 > out there that will make this easier, but it's simple enough to script it,
22 > something like this should work:
23 >
24 > qlist -I --nocolor | while read pkg; do
25 > if [ ! -d "/var/portage/$pkg" ]; then
26 > echo "$pkg is not in portage"
27 > fi
28 > done
29 >
30 > This will not catch overlays, but it could be easily extended to do so,
31 > it's just a generic (and untested) example. It should work I guess. It just
32 > dumps the list of installed packages, then tries to find a dir with the
33 > same name under your portage directory and if it doesn't exist then the
34 > package name is printed.
35 >
36
37
38 The best place for this would be
39
40 equery orphan <params>
41
42 or similar. I'm sure the maintainer will gratefully accept patches :-)
43
44 --
45 alan dot mckinnon at gmail dot com