From owner-freebsd-ports@FreeBSD.ORG Wed Mar 26 09:58:24 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83DC11065672 for ; Wed, 26 Mar 2008 09:58:24 +0000 (UTC) (envelope-from roam@ringlet.net) Received: from straylight.ringlet.net (nat85.cnsys.bg [85.95.80.85]) by mx1.freebsd.org (Postfix) with SMTP id D212F8FC21 for ; Wed, 26 Mar 2008 09:58:23 +0000 (UTC) (envelope-from roam@ringlet.net) Received: (qmail 73319 invoked by uid 1000); 26 Mar 2008 09:58:22 -0000 Date: Wed, 26 Mar 2008 11:58:21 +0200 From: Peter Pentchev To: Doug Barton Message-ID: <20080326095821.GA1034@straylight.m.ringlet.net> Mail-Followup-To: Doug Barton , Lars Stokholm , freebsd-ports@freebsd.org References: <47E949A3.5030103@gmail.com> <47E9991A.2020507@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <47E9991A.2020507@FreeBSD.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-ports@freebsd.org, Lars Stokholm Subject: Re: Cleaning /var/db/ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2008 09:58:24 -0000 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 25, 2008 at 05:30:18PM -0700, Doug Barton wrote: > Lars Stokholm wrote: >> Apart from doing 'rm -r /var/db/ports/*' is there a way of cleaning the= =20 >> folder of stale folders and files? >=20 > Not an automated one, no. It would also be somewhat difficult (although n= ot=20 > impossible) to write an automated tool to do it because of the loose=20 > relationship between the names in /var/db/ports and the names in=20 > /var/db/pkg. Or maybe it's not that difficult, just a bit time-consuming (for the tool, not the writer :)) - it's just a Simple Matter Of Scripting(tm) something like: cd /var/db/pkg for p in *; do if [ -d "$p" ] && [ -f "$p/+CONTENTS" ]; then o=3D`awk -F: '$1 =3D /@comment ORIGIN/ {print $2}' "$p/+CONTENTS"` n=3D`make -C "/usr/ports/$o" -V UNIQUENAME` printf '%s:%s:%s\n' "$p" "$o" "$n" fi done G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@cnsys.bg roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 I am not the subject of this sentence. --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkfqHj0ACgkQ7Ri2jRYZRVOW+gCfUdz+0tA2UflWMjOE4bLWMInt wrgAnjNs5rCLdYMfIl5ZuguZcWelHexI =c6lA -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi--