Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Mar 2008 11:58:21 +0200
From:      Peter Pentchev <roam@ringlet.net>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        freebsd-ports@freebsd.org, Lars Stokholm <lars.stokholm@gmail.com>
Subject:   Re: Cleaning /var/db/ports
Message-ID:  <20080326095821.GA1034@straylight.m.ringlet.net>
In-Reply-To: <47E9991A.2020507@FreeBSD.org>
References:  <47E949A3.5030103@gmail.com> <47E9991A.2020507@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080326095821.GA1034>