From: Andy Arbon <gentoo@andrewarbon.co.uk>
To: gentoo-user@gentoo.org, gentoo-dev <gentoo-dev@gentoo.org>
Subject: [gentoo-dev] Disk space && managing package binaries
Date: Mon, 24 Mar 2003 21:39:38 +0000 [thread overview]
Message-ID: <3E7F7B1A.2050108@andrewarbon.co.uk> (raw)
In-Reply-To: <web-205338@rems02.cluster1.charter.net>
Hello,
Related to my recent question on gentoo-user regarding freeing up disk
space, I've just written a short bash script that helps tidying up the
binary packages that portage builds (see below).
All it does it take each file in the distfiles and packages directories
and use qpkg to see if the package that built/came from it is currently
installed. If it isn't then it's removed.
There are obviously shortcomings with this, but as a rough tool it
works. One problem is that if you have a package like rsync-1.2.3 and
rsync-1.2.3-r1 then rsync-1.2.3 won't get removed until the system gets
upgraded to rsync-1.2.4, as (AFAIK) there's no way to specify
end-of-string in a query to qpkg (am I wrong about this?)
At the moment it moves packages into a subdirectory ready to be removed
but doesn't actually remove them.
Any comments on this?
Cheers,
Andy
#!/bin/bash
# Clean out of date packages and distfiles out
PPATH="/usr/portage/packages/All"
DPATH="/usr/portage/distfiles"
FILELIST=`find $PPATH| sed -e \
's/.*\/\(.*\)\.\(tar.bz2$\|zip\|tar.gz$\|tbz2\|bz2\|gz\)$/\1/g' -e '1d'`
if [[ -z "$PPATH/../old" ]];
then mkdir "$PPATH/../old"
fi
for file in $FILELIST; do
echo -n "Testing $file "
if [[ ! `qpkg -I $file` ]];
then mv $PPATH/$file* $PPATH/../old/
echo "... removing";
else echo
fi
done
# Now we do the distfiles
FILELIST=`find $DPATH| sed -e \
's/.*\/\(.*\)\.\(tar.bz2$\|zip\|tar.gz$\|tbz2\|bz2\|gz\|exe\|wsz\|tgz\|patch\|bin\|tar.Z\)$/\1/g'
-e '1d'`
if [[ -z "$DPATH/../old" ]];
then mkdir "$DPATH/../old"
fi
for file in $FILELIST; do
echo -n "Testing $file "
if [[ ! `qpkg -I $file` ]];
then mv $DPATH/$file* $DPATH/../old/
echo "... removing";
else echo
fi
done
--
gentoo-dev@gentoo.org mailing list
parent reply other threads:[~2003-03-24 21:39 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <web-205338@rems02.cluster1.charter.net>]
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=3E7F7B1A.2050108@andrewarbon.co.uk \
--to=gentoo@andrewarbon.co.uk \
--cc=gentoo-dev@gentoo.org \
--cc=gentoo-user@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