1 |
Cool! I can see myself using this script routinely. |
2 |
|
3 |
That said, since one *must* check the resulting script anyway, why not |
4 |
start the editor directly after chmod? E.g.: |
5 |
|
6 |
$EDITOR cleanscript |
7 |
|
8 |
Oh, also don't forget to delete cleanscript.000 ;) |
9 |
|
10 |
Rgds, |
11 |
|
12 |
|
13 |
On 2011-08-20, Walter Dnes <waltdnes@××××××××.org> wrote: |
14 |
> On Fri, Aug 19, 2011 at 05:19:29PM +0200, Space Cake wrote |
15 |
> |
16 |
>> I'll try to avoid as many kde/gnome application as I can :) I don't |
17 |
>> really like them because I want to have my window in front of me right |
18 |
>> when click on the icon :). I just started to clean-up my useflags, |
19 |
>> changed to desktop profile and I'll leave my machine here for the |
20 |
>> weekend to re-emerge everything is needed for this change. I'm sure |
21 |
>> some revdep-rebuild and depclean still waiting for me and also I think |
22 |
>> lot of kde / gnome libs will remain because of the dependencies... |
23 |
> |
24 |
> Here's my "autodepclean" script. It parses the output of a pretend |
25 |
> depclean and generates, but does not execute, a script called |
26 |
> "cleanscript", which has to be run as root. Note the warning to check |
27 |
> "cleanscript" before running it. Remove the commands to unmerge the |
28 |
> stuff you want to keep. In addition to some gentoo-sources kernels, it |
29 |
> now wants to remove nano, ever since "virtual/editor" showed up in |
30 |
> Gentoo. I get the warning... |
31 |
> |
32 |
> !!! 'app-editors/nano' (virtual/editor) is part of your system profile. |
33 |
> !!! Unmerging it may be damaging to your system. |
34 |
> |
35 |
> Here's the script... |
36 |
> |
37 |
> #!/bin/bash |
38 |
> # autodepclean script v 0.01 released under GPL v3 by Walter Dnes 2010/08/18 |
39 |
> # Generates a file "cleanscript" to remove unused ebuilds, including |
40 |
> # buildtime-only dependancies. |
41 |
> # |
42 |
> # Warning; this script is still beta. I recommend that you check the output |
43 |
> # in cleanscript before running it. It is agressive about removing unused |
44 |
> # gentoo-sources versions. This includes those that are higher than your |
45 |
> # current kernel. This is technically correct for removing unused ebuilds, |
46 |
> # but it may not be what you want. |
47 |
> # |
48 |
> echo "#!/bin/bash" > cleanscript |
49 |
> echo "#" > cleanscript.000 |
50 |
> emerge --pretend --depclean |\ |
51 |
> grep -A1 "^ .*/" |\ |
52 |
> grep -v "^ \*" |\ |
53 |
> grep -v "^--" |\ |
54 |
> sed ":/: { |
55 |
> N |
56 |
> s:\n:: |
57 |
> s/ selected: /-/ |
58 |
> s/^ /emerge --depclean =/ |
59 |
> }" >> cleanscript.000 |
60 |
> while read |
61 |
> do |
62 |
> echo "${REPLY}" >> cleanscript |
63 |
> if [ "${REPLY:0:6}" == "emerge" ]; then |
64 |
> echo "revdep-rebuild" >> cleanscript |
65 |
> fi |
66 |
> done < cleanscript.000 |
67 |
> chmod 744 cleanscript |
68 |
> |
69 |
> |
70 |
> -- |
71 |
> Walter Dnes <waltdnes@××××××××.org> |
72 |
> |
73 |
> |
74 |
|
75 |
|
76 |
-- |
77 |
-- |
78 |
Pandu E Poluan - IT Optimizer |
79 |
My website: http://pandu.poluan.info/ |