From owner-freebsd-ports Thu Apr 27 10:20:14 2000 Delivered-To: freebsd-ports@freebsd.org Received: from ipt2.iptelecom.net.ua (ipt2.iptelecom.net.ua [212.9.224.2]) by hub.freebsd.org (Postfix) with ESMTP id 7B92A37C06F for ; Thu, 27 Apr 2000 10:20:06 -0700 (PDT) (envelope-from sobomax@altavista.net) Received: from vega.vega.com (dialup6-43.iptelecom.net.ua [212.9.227.107]) by ipt2.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id TAA02458; Thu, 27 Apr 2000 19:36:07 +0300 (EEST) Received: from altavista.net (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.9.3/8.9.3) with ESMTP id TAA21115; Thu, 27 Apr 2000 19:27:21 +0300 (EEST) (envelope-from sobomax@altavista.net) Message-ID: <39086A69.2FB1C91D@altavista.net> Date: Thu, 27 Apr 2000 19:27:21 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.72 [en] (WinNT; I) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: mharo@area51.fremont.ca.us Cc: ports@FreeBSD.ORG Subject: Re: port helper scripts directory References: <20000426170301.A24093@area51.fremont.ca.us> <3907F075.1D6865E8@altavista.net> <20000427075903.A39186@area51.fremont.ca.us> Content-Type: multipart/mixed; boundary="------------6AA0B7EB5CE92CCD166B003F" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------6AA0B7EB5CE92CCD166B003F Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Michael Haro wrote: > That sounds pretty cool. Please send it to me. > > Michael > > On Thu, Apr 27, 2000 at 10:47:01AM +0300, Maxim Sobolev wrote: > > > > Good idea. I personally have a script to clean unmatched distfiles (i.e. > > distfiles that do not have associated md5 entries in /usr/ports/*), so if > > it is interesting for you please let me know. Here it is. It could be easily expanded for unattended operation, but I usually preffer to run it manually, so newer actually felt the need to adjust it. -Maxim --------------6AA0B7EB5CE92CCD166B003F Content-Type: application/x-sh; name="distclean.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="distclean.sh" #!/bin/sh # distclean # Compare distfiles in /usr/ports/distfiles # with currently instaled ports collection # and removes outdated files # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42, (c) Poul-Henning Kamp): # Maxim Sobolev ." echo "Assumes that your ports in /usr/ports and distfiles in /usr/ports/distfiles." echo "" umask 077 FN_PORTS=`mktemp -t dclean` || exit 1 FN_DISTFILES=`mktemp -t dclean` || exit 1 FN_RESULTS_SCRIPT=`mktemp -t dclean` || exit 1 echo -n "Building ports md5 index..." find /usr/ports -name "md5" -type f -exec cat {} \; |grep "^MD5 ("| sort | uniq > $FN_PORTS echo "Done." P_MD5_COUNT=`wc -l $FN_PORTS | sed "s| $FN_PORTS|| ; s| ||g"` echo "Found $P_MD5_COUNT md5 entries in your ports directory." echo -n "Building distfiles md5 index..." find -H /usr/ports/distfiles -type f -exec md5 {} \; | sed 's|/usr/ports/distfiles/||' | sort > $FN_DISTFILES echo "Done." D_MD5_COUNT=`wc -l $FN_DISTFILES | sed "s| $FN_DISTFILES|| ; s| ||g"` echo "Found $D_MD5_COUNT distfile(s) in your distfiles directory." echo -n "Comparing results..." diff -d $FN_DISTFILES $FN_PORTS | grep "^<" | sed 's|.*(|rm -i /usr/ports/distfiles/| ; s|).*||' > $FN_RESULTS_SCRIPT echo "Done." R_MD5_COUNT=`wc -l $FN_RESULTS_SCRIPT | sed "s| $FN_RESULTS_SCRIPT|| ; s| ||g"` echo "$R_MD5_COUNT distfile(s) doesn't have corresponding md5 entries in ports directory." /bin/sh $FN_RESULTS_SCRIPT echo -n "Finishing..." rm -f $FN_RESULTS_SCRIPT $FN_PORTS $FN_DISTFILES echo "Done." --------------6AA0B7EB5CE92CCD166B003F-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message