From: "José Fonseca" <j_r_fonseca@yahoo.co.uk>
To: Marko Mikulicic <marko@seul.org>
Cc: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] Script to clean old files from /usr/portage/distfiles
Date: Tue, 12 Nov 2002 00:54:19 +0000 [thread overview]
Message-ID: <20021112005419.GA27162@localhost.localdomain> (raw)
In-Reply-To: <3DD04B78.9010806@seul.org>
On Tue, Nov 12, 2002 at 01:29:44AM +0100, Marko Mikulicic wrote:
> You read my mind!
> I was just thinking "i'd like to have a script that ...."
> and you come out with this. great.
> thanks. I should think more often :-)
>
I'm glad you liked it.
> It would be nice if this script would appear in gentoolkit...
>
> >
> >I've started with a shell script, then python, then I've read qpkg.sh,
> >ebuild.sh, portage.py and many others in the search of the easiest way
> >to do this. In the end everything boiled down to 2 lines - the rest is
> >just sintatic sugar!
> nice. I just love when sed transforms the command line in completely
> unreadable magic :-)
>
> How would be to make it a bit shorter and more configurable in one shot ?:
>
> -PORTDIR=/usr/portage
> -DISTDIR=$PORTDIR/distfiles
> +. /etc/make.globals;. /etc/make.conf
> (or: for i in /etc/make.{globals,conf} do . $i;done )
This is ok...
> -CACHEDIR=$PORTDIR/metadata/cache
> -PKGDBDIR=/var/db/pkg
...but becare full with these - you should keep them because they're
really not defined on the above files and the getting the last one wrong
will lead to the deletion of all files in distfiles...!
The way the script work is first get the list of all sources related
with the installed files from portache cache, merge it with the list of
sources in distfiles, and delete those which are unique - i.e., only are
in distfiles. There are two caveats with this procedure:
- it will delete sources of packages in PORTAGE_OVERLAY, if you have
any, since they aren't cached.
- if the cache is busted (or can't be found), the most probable outcome
is that all files in distfiles get deleted... so a good idea is to
replace 'rm' by 'echo' to get an idea of what is gonna be deleted.
These two caveats could be overcomed by getting the sources directly
from the installed ebuilds, but that would be terribly slow compared
with this, due to the parsing of all ebuilds.
Regards,
José Fonseca
__________________________________________________
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
--
gentoo-dev@gentoo.org mailing list
next prev parent reply other threads:[~2002-11-12 0:54 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
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 [this message]
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=20021112005419.GA27162@localhost.localdomain \
--to=j_r_fonseca@yahoo.co.uk \
--cc=gentoo-dev@gentoo.org \
--cc=marko@seul.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