public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "José Fonseca" <j_r_fonseca@yahoo.co.uk>
To: Nick Jones <carpaski@twobit.net>
Cc: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] Script to clean old files from /usr/portage/distfiles
Date: Tue, 12 Nov 2002 10:21:44 +0000	[thread overview]
Message-ID: <20021112102144.GA20309@localhost.localdomain> (raw)
In-Reply-To: <20021111212849.A23035@twobit.net>

[-- Attachment #1: Type: text/plain, Size: 981 bytes --]

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

[-- Attachment #2: distfiles-clean --]
[-- Type: text/plain, Size: 1149 bytes --]

#!/bin/sh
#
# distfiles-clean
#
# Cleans unused files from Portage's distfiles directory.
#
# José Fonseca <j_r_fonseca@yahoo.co.uk>

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


[-- Attachment #3: Type: text/plain, Size: 37 bytes --]

--
gentoo-dev@gentoo.org mailing list

  parent reply	other threads:[~2002-11-12 10:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-11 20:38 [gentoo-dev] Script to clean old files from /usr/portage/distfiles José Fonseca
2002-11-11 23:42 ` Johannes Ballé
2002-11-12  1:13   ` José Fonseca
2002-11-12  2:01     ` Marko Mikulicic
     [not found]       ` <20021111212849.A23035@twobit.net>
2002-11-12 10:21         ` José Fonseca [this message]
2002-11-12 11:28           ` William Kenworthy
2002-11-12 12:28             ` José Fonseca
2002-11-12 15:37           ` Nils Ohlmeier
2002-11-12 17:56             ` José Fonseca
2002-11-12 23:12               ` Nils Ohlmeier
2002-11-12  0:29 ` Marko Mikulicic
2002-11-12  0:54   ` José Fonseca
2002-11-12  1:50     ` Marko Mikulicic
  -- strict thread matches above, loose matches on Subject: below --
2003-03-25 18:55 DJ Cozatt
2003-03-25 20:34 ` Chris Bainbridge
2003-03-27  4:53   ` DJ Cozatt

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=20021112102144.GA20309@localhost.localdomain \
    --to=j_r_fonseca@yahoo.co.uk \
    --cc=carpaski@twobit.net \
    --cc=gentoo-dev@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