Re: one liner to clean up your /usr/ports/distfiles

From: Vadim Goncharov <vadimnuclight_at_tpu.ru>
Date: Fri, 30 Jun 2006 14:56:49 +0700
30.06.06 _at_ 13:59 MonkeyBrains wrote:

> Ever notice your /usr/ports/distfiles bloats after several years of  
> updating the same box?
> You  know those 5 year old drives are about to fail, but, if you want to  
> clean them up a bit, I like this:
>
>  cd /usr/ports/distfiles
>  perl -e 'while (<*>) { chomp(); $p = $_; $p =~ s/\-\d+\..*// or next;  
> unlink $X if $X =~ /^$p/; $X = $_;}'
>
> Removes the lower version number of 'double' source files, like these:
>  -rw-r--r--  1 root  wheel  1282627 Sep 12  2005 tiff-3.7.4.tar.gz
>  -rw-r--r--  1 root  wheel  1336295 Mar 23 07:15 tiff-3.8.2.tar.gz

portsclean -D

This one-liner removes even more older distfiles.

-- 
WBR, Vadim Goncharov
Received on Fri Jun 30 2006 - 05:57:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:57 UTC