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




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

Rudy
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: one liner to clean up your /usr/ports/distfiles
    ... 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: ...
    (freebsd-current)
  • Re: one liner to clean up your /usr/ports/distfiles
    ... MonkeyBrains wrote: ... 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: ...
    (freebsd-current)
  • Re: win2000 server software mirroring drive failure question
    ... I assume no matter what drive it is fail safe ... >>Break the mirror on the drives, remove the bad drive, ... >>Windows 2000/2003 Server group ...
    (microsoft.public.win2000.general)
  • Re: Dell Dimension 2350 behaving oddly, loosing devices
    ... It might also be the PS starting to fail, I've seen it before in 2350's. ... an 80Gb and 200Gb maxtor drives. ... Type in your service tag or select your model and then "drivers and ... downloads" in the lower drop-down below the tag field. ...
    (alt.sys.pc-clone.dell)
  • Re: Hard Drive Recommendations
    ... I've also had a Maxtor internal fail. ... The drives I've had fail have been the IBM Deskstar. ... running Seagate Barracudas, a Maxtor and a couple of IBM Deskstars. ...
    (rec.photo.digital)