From owner-freebsd-ports@FreeBSD.ORG Mon Jan 23 00:38:47 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 616D516A420 for ; Mon, 23 Jan 2006 00:38:47 +0000 (GMT) (envelope-from parv@pair.com) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB97943D45 for ; Mon, 23 Jan 2006 00:38:46 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([68.67.248.200]) by mta11.adelphia.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060123003846.RGDB5278.mta11.adelphia.net@default.chvlva.adelphia.net>; Sun, 22 Jan 2006 19:38:46 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id DB525B6C4; Sun, 22 Jan 2006 19:38:41 -0500 (EST) Date: Sun, 22 Jan 2006 19:38:41 -0500 From: Parv To: randall ehren Message-ID: <20060123003841.GA46981@holestein.holy.cow> Mail-Followup-To: randall ehren , freebsd-ports@freebsd.org References: <43D41AC2.206@ucsb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43D41AC2.206@ucsb.edu> Cc: freebsd-ports@freebsd.org Subject: Re: ports cleaning script X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: f-ports List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2006 00:38:47 -0000 in message <43D41AC2.206@ucsb.edu>, wrote randall ehren thusly... > > a few years ago i wrote a small perl script to cleanup all ports > that had a 'work' directory, aka a 'make clean'. it's quite > simple, but i haven't found anything that does a similar thing. > > cleanup_port_ports.pl: > #!/usr/bin/perl > > #### > ### > ## clean out the ports tree (remove all the 'work' directories) > # randall s. ehren 20001011 > > @works = `/usr/bin/find /usr/ports/ -name work`; That's very dangerous looking: that will find any file or directory at any depth. If you are going to put $PORTSDIR as hardcoded value, why not add -depth & -type options ... find /usr/ports -name work -type d -depth 3 ... ? Or, just set $WRKDIRPREFIX and fire "rm -rf $WRKDIRPREFIX/*" at will. > foreach $directory (@works) { > print "removing $directory"; > `/bin/rm -r $directory`; > } - Parv --