From owner-freebsd-current@FreeBSD.ORG Fri Jun 30 09:00:06 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A12216A47E for ; Fri, 30 Jun 2006 09:00:06 +0000 (UTC) (envelope-from dmitry@atlantis.dp.ua) Received: from postman.atlantis.dp.ua (postman.atlantis.dp.ua [193.108.47.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 629BE4482E for ; Fri, 30 Jun 2006 09:00:04 +0000 (GMT) (envelope-from dmitry@atlantis.dp.ua) Received: from smtp.atlantis.dp.ua (smtp.atlantis.dp.ua [193.108.46.231]) by postman.atlantis.dp.ua (8.13.1/8.13.1) with ESMTP id k5U8xvQS078292; Fri, 30 Jun 2006 11:59:57 +0300 (EEST) (envelope-from dmitry@atlantis.dp.ua) Date: Fri, 30 Jun 2006 11:59:57 +0300 (EEST) From: Dmitry Pryanishnikov To: MonkeyBrains In-Reply-To: <44A4CBE1.9060205@MonkeyBrains.NET> Message-ID: <20060630115131.E65713@atlantis.atlantis.dp.ua> References: <44A4CBE1.9060205@MonkeyBrains.NET> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org Subject: Re: one liner to clean up your /usr/ports/distfiles X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2006 09:00:06 -0000 Hello! On Thu, 29 Jun 2006, 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 1. FreeBSD-ports@freebsd.org list suits better for such a letter. 2. Your approach is not correct, because there are many ports which _do_ refer different versions of the same product. Just now: Port name Distfiles lang/gcc33 gcc-core-3.3.6.tar.bz2 ... lang/gcc34 gcc-core-3.4.6.tar.bz2 ... lang/gcc40 gcc-core-4.0-20060622.tar.bz2 ... lang/gcc41 gcc-core-4.1-20060623.tar.bz2 ... For the _correct_ approach, see, e.g., portsclean -D which comes with the port sysutils/portupgrade. > Rudy Sincerely, Dmitry -- Atlantis ISP, System Administrator e-mail: dmitry@atlantis.dp.ua nic-hdl: LYNX-RIPE