From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5796 invoked by uid 1002); 12 Nov 2002 10:22:12 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 5787 invoked from network); 12 Nov 2002 10:22:12 -0000 Date: Tue, 12 Nov 2002 10:21:44 +0000 From: =?iso-8859-15?Q?Jos=E9?= Fonseca To: Nick Jones Cc: gentoo-dev@gentoo.org Message-ID: <20021112102144.GA20309@localhost.localdomain> References: <20021111203828.GA10784@localhost.localdomain> <200211120042.41107.joba123@arcor.de> <20021112011310.GB27162@localhost.localdomain> <3DD0610F.1060902@seul.org> <20021111212849.A23035@twobit.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20021111212849.A23035@twobit.net> User-Agent: Mutt/1.4i Subject: Re: [gentoo-dev] Script to clean old files from /usr/portage/distfiles X-Archives-Salt: eb59047a-5fd9-4265-a882-5e72a34a968b X-Archives-Hash: 6d5385414386ae4a7e12849e8d0658c4 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Nov 11, 2002 at 09:28:49PM -0600, Nick Jones wrote: > metadata is _not_ something you should be using. metadata is a > quick-search cache database that is updated remotely. It has a basic > link to your system, but should in no way be used to determine > settings and data as it can be out of date. It's primary purpose is > for searching. /var/cache/edb/dep is a valid, local system cache. Thanks! I hadn't noticed the existence of /var/cache/edb/dep. Using it instead of /usr/portage/metadata/cache works flawlessly. All interested, please check the attached new version. It includes all suggestions which were made so far. It requires >=sed-4.0, otherwise replace "xargs sed -s" by "xargs -l sed". If there aren't further corrections/suggestions then I'll create a bug in bugzilla for it. > Try this: > > FEATURES="mirror" emerge -efp world | ... Unfortunately when doing this, emerge starts complaining that it can't satisfy dependencies. Regards, José Fonseca --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename=distfiles-clean Content-Transfer-Encoding: 8bit #!/bin/sh # # distfiles-clean # # Cleans unused files from Portage's distfiles directory. # # José Fonseca PROGRAM=`basename "$0"` while [ ${#} -gt 0 ] do case "$1" in -h|--help) USAGE=y break ;; -p|--pretend) PRETEND=y ;; *) echo "$PROGRAM: Invalid option \'$1\'" 1>&2 USAGE=y break ;; esac shift done # For PORTDIR and DISTDIR . /etc/make.globals . /etc/make.conf if [ "$USAGE" ] then echo "Usage: $PROGRAM [-h|--help] [-p|--pretend]" echo "Cleans unused files from $DISTDIR directory." exit fi DBDIR=/var/db/pkg CACHEDIR=/var/cache/edb/dep for DIR in "$PORTDIR" "$DISTDIR" "$DBDIR" "$CACHEDIR" do if [ ! -d "$DIR" ] then echo "$PROGRAM: \'$DIR\' not found." exit fi done TMPFILE=`mktemp /tmp/$0.XXXXXX` find $DBDIR -name '*.ebuild' | sed -n -e "s:^$DBDIR/\([^/]*\)/\([^/]*\)/\([^/]*\)\.ebuild$:$CACHEDIR/\1/\3:p" | xargs sed -s -e '4!d;s/[[:space:]]\+/\n/g' | sed -n -e 's:^.*/::p' | sort -u > $TMPFILE && ls -1 $DISTDIR | grep -v '^cvs-src$' | comm -23 - $TMPFILE | { if [ "$PRETEND" ] then cat else sed -e "s:^:$DISTDIR/:" | xargs rm -f fi } rm $TMPFILE --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii -- gentoo-dev@gentoo.org mailing list --cNdxnHkX5QqsyA0e-- __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com