Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2006 19:38:41 -0500
From:      Parv <parv@pair.com>
To:        randall ehren <randall@ucsb.edu>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: ports cleaning script
Message-ID:  <20060123003841.GA46981@holestein.holy.cow>
In-Reply-To: <43D41AC2.206@ucsb.edu>
References:  <43D41AC2.206@ucsb.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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

-- 




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