From: "Walter Dnes" <waltdnes@waltdnes.org>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] autodepclean script (was "how to remove HAL")
Date: Wed, 18 Aug 2010 23:05:41 -0400 [thread overview]
Message-ID: <20100819030541.GA7423@waltdnes.org> (raw)
In-Reply-To: <20100817194922.GB6494@nibiru.local>
[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]
On Tue, Aug 17, 2010 at 09:49:22PM +0200, Enrico Weigelt wrote
> I've just experimented a bit with that and it turned out that
> --depclean doesn't clean up the buildtime-only deps. But if I
> remove one of them (eg. cabextract), they don't get pulled in again
> (that's indicating the depending ebuilds are written properly).
This reminds me of a script I've been working on to remove unnecessary
cruft. Everything that follows is run as root, because it runs
"emerge". The attached script "autodepclean" parses the output from
"emerge --pretend --depclean" and generates a script "cleanscript" that
you can run to clean up your system. This should handle your situation,
but it's also a general solution to the entire class of problems of
cleaning up when you remove all programs or USE flags that pull in a
lib. It is not restricted to just HAL
Warning, this script is beta. Use with care. It will remove
gentoo-sources versions higher than your current kernel. This is
technically correct for removing unused ebuilds. But it may not be what
you want.
--
Walter Dnes <waltdnes@waltdnes.org>
[-- Attachment #2: autodepclean --]
[-- Type: text/plain, Size: 952 bytes --]
#!/bin/bash
# autodepclean script v 0.01 released under GPL v3 by Walter Dnes 2010/08/18
# Generates a file "cleanscript" to remove unused ebuilds, including
# buildtime-only dependancies.
#
# Warning; this script is still beta. I recommend that you check the output
# in cleanscript before running it. It is agressive about removing unused
# gentoo-sources versions. This includes those that are higher than your
# current kernel. This is technically correct for removing unused ebuilds,
# but it may not be what you want.
#
echo "#!/bin/bash" > cleanscript
echo "#" > cleanscript.000
emerge --pretend --depclean |\
grep -A1 "^ .*/" |\
grep -v "^ \*" |\
grep -v "^--" |\
sed ":/: {
N
s:\n::
s/ selected: /-/
s/^ /emerge --depclean =/
}" >> cleanscript.000
while read
do
echo "${REPLY}" >> cleanscript
if [ "${REPLY:0:6}" == "emerge" ]; then
echo "revdep-rebuild" >> cleanscript
fi
done < cleanscript.000
chmod 744 cleanscript
next prev parent reply other threads:[~2010-08-19 3:06 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-28 2:44 [gentoo-user] how to remove HAL sam new
2010-07-28 5:01 ` Alan McKinnon
2010-07-28 13:34 ` sam new
2010-07-28 15:08 ` Alan McKinnon
2010-07-29 2:26 ` sam new
2010-07-29 6:39 ` Alan McKinnon
2010-07-29 8:07 ` sam new
2010-07-28 16:46 ` Volker Armin Hemmann
2010-07-28 8:05 ` Neil Bothwick
2010-08-17 19:49 ` Enrico Weigelt
2010-08-18 13:22 ` Mike Edenfield
2010-08-19 3:05 ` Walter Dnes [this message]
2010-08-21 10:07 ` [gentoo-user] Re: autodepclean script (was "how to remove HAL") Francesco Talamona
2010-08-21 23:32 ` Walter Dnes
2010-08-22 9:45 ` Francesco Talamona
2010-08-19 9:57 ` [gentoo-user] how to remove HAL Neil Bothwick
2010-07-28 16:31 ` [gentoo-user] " Nikos Chantziaras
2010-07-28 17:23 ` Neil Bothwick
2010-07-28 18:50 ` Nikos Chantziaras
2010-07-28 20:54 ` Andrey Vul
2010-07-28 21:08 ` Nikos Chantziaras
2010-07-28 21:22 ` Alan McKinnon
2010-07-29 0:31 ` [gentoo-user] " Andrey Vul
2010-07-29 0:38 ` [gentoo-user] " Nikos Chantziaras
2010-07-29 0:44 ` Nikos Chantziaras
2010-07-29 0:33 ` [gentoo-user] " Andrey Vul
2010-07-29 2:24 ` [gentoo-user] " sam new
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100819030541.GA7423@waltdnes.org \
--to=waltdnes@waltdnes.org \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox