From owner-freebsd-ports@FreeBSD.ORG Sat Nov 4 18:54:40 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7181416A412 for ; Sat, 4 Nov 2006 18:54:40 +0000 (UTC) (envelope-from beech@alaskaparadise.com) Received: from stargate.alaskaparadise.com (114-103-74-65.gci.net [65.74.103.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8597D43D58 for ; Sat, 4 Nov 2006 18:54:37 +0000 (GMT) (envelope-from beech@alaskaparadise.com) Received: by stargate.alaskaparadise.com (Postfix, from userid 0) id 695D1416B; Sat, 4 Nov 2006 09:54:36 -0900 (AKST) From: Beech Rintoul Organization: Alaska Paradise Travel To: freebsd-ports@freebsd.org Date: Sat, 4 Nov 2006 09:54:17 -0900 User-Agent: KMail/1.9.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2059093.yjGk23l7dF"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200611040954.34644.beech@alaskaparadise.com> Cc: "J. R. Lenz" Subject: Re: useful shell script 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: Sat, 04 Nov 2006 18:54:40 -0000 --nextPart2059093.yjGk23l7dF Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 04 November 2006 09:40, J. R. Lenz wrote: > Reclaiming disk space was a high priority on my laptop, which has a 4gb > FreeBSD partition. So, I wrote a useful shell script for removing all the > "work" directories in the ports tree (I'm sure someone has already done > this, but it saves a little bit of time for those people who are not > fluent in shell scripting). You'd be surprised how much disk space can be > freed up by removing unused source code and compiled objects. > > Peace, > - Ralf > > #!/bin/sh > # > # remove_work.sh > # removes nasty, disk-hogging source code > # and compiled objects from ports tree > # > # J. Ralf Lenz > # > > for i in `ls -Ad *` > do > if [ -d /usr/ports/$i ]; then > cd $i > DIR=3D`pwd` > DESIRED_PATH=3D/usr/ports/$i > if [ "${DIR}" =3D "${DESIRED_PATH}" ]; then > for j in `ls -Ad *` > do > if [ -d /usr/ports/$i/$j ]; then > cd /usr/ports/$i/$j > if [ -d /usr/ports/$i/$j/work ]; then > CUR_DIR=3D`pwd` > echo "Removing ${CUR_DIR}/work..." > rm -rf work > fi > cd /usr/ports/$i > fi > done > cd /usr/ports > fi > fi > done > portsclean -CDLP cheers, Beech =2D-=20 =2D------------------------------------------------------------------------= =2D------------- Beech Rintoul - Sys. Administrator - beech@alaskaparadise.com /"\ ASCII Ribbon Campaign | Alaska Paradise Travel \ / - NO HTML/RTF in e-mail | 201 East 9Th Avenue Ste.310 X - NO Word docs in e-mail | Anchorage, AK 99501 / \ - Please visit Alaska Paradise - http://www.alaskaparadise.com =2D------------------------------------------------------------------------= =2D------------- --nextPart2059093.yjGk23l7dF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFTOHqp5D0B1NlT4URAoXQAJ0db/Sj3CCSNZh8xvXEo2rioB1uPQCeJPIR /giax2e7qClqKFYpXvEogA4= =N2A+ -----END PGP SIGNATURE----- --nextPart2059093.yjGk23l7dF--