Gentoo Archives: gentoo-dev

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Sets vs Meta ebuilds
Date: Tue, 11 Jul 2017 04:23:47
Message-Id: 20170711042333.GA16347@waltdnes.org
In Reply to: Re: [gentoo-dev] Sets vs Meta ebuilds by "William L. Thomson Jr."
1 I have a script I've written for my own use. It's not 100% polished,
2 but it does the job for me. My "autodepclean" script runs
3 "emerge --pretend --depclean", and reformats the output into another
4 script, named "cleanscript", which contains a bunch of lines like...
5
6 emerge --depclean --verbose =fu-bar/xyz-1.2.3
7
8 Before running "./cleanscript", I check it for problems. Here's the
9 autodepclean script...
10
11 #!/bin/bash
12 # autodepclean script v 0.04 released under GPL v3 by Walter Dnes 2012/07/09
13 # Generates a file "cleanscript" to remove unused ebuilds, including
14 # buildtime-only dependancies.
15 #
16 # Warning; this script is still beta. I recommend that you check the output
17 # in cleanscript before running it.
18 #
19 # With the arrival of "virtual/editor", the script now suggests removing
20 # app-editors/nano, which may not be what you want. If you want to keep
21 # nano, put it into world
22 #
23 # version 0.03 disables the removal of gentoo-sources. Your current kernel
24 # is not always the most recent one in /usr/src.
25 #
26 # version 0.04 adds "--verbose" to the "emerge --depclean". This makes it
27 # easier to track down circular dependancies.
28 #
29 echo "#!/bin/bash" > cleanscript
30 echo "#" >> cleanscript
31 emerge --pretend --depclean |\
32 grep -A1 "^ .*/" |\
33 grep -v "^ \*" |\
34 grep -v "^--" |\
35 sed ":/: {
36 N
37 s:\n::
38 s/ selected: /-/
39 s/^ /emerge --depclean --verbose =/
40 }" | grep -v "gentoo-sources" >> cleanscript
41 echo "revdep-rebuild" >> cleanscript
42 chmod 744 cleanscript
43
44 --
45 Walter Dnes <waltdnes@××××××××.org>
46 I don't run "desktop environments"; I run useful applications