#!/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 wrote this file. As long as you retain # this notice you can do whatever you want with this stuff. If we meet some # day, and you think this stuff is worth it, you can buy me a beer in return. # # Maxim Sobolev # ---------------------------------------------------------------------------- # # $FreeBSD: /tmp/pcvs/ports/Tools/scripts/distclean.sh,v 1.5 2000-10-09 06:23:44 sobomax Exp $ # # MAINTAINER= sobomax@FreeBSD.org PATH=/sbin:/bin:/usr/bin echo "Distfiles clean utility by 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 "distinfo" -type f | xargs 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 /usr/ports/distfiles/ -type f | xargs 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." 44/cgit/cgit.cgi/freebsd-ports-graphics/refs/?id=698b3bc1b9a2644d07e39444f2d1f1e1117c363b'>refslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* - Mark ports that have been broken for six month or more, or never compiled onpav2011-03-171-0/+2
* Add missed patch filepav2010-01-281-0/+72
* - Update to 3.11.1.0pav2010-01-283-28/+25
* This port has been broken for 3+ months, thuspav2009-12-081-0/+2
* - Update lang/ocaml to 3.11.0. [1]stas2009-04-111-0/+1
* - Update to 3.10.0.1pav2008-04-152-7/+8
* - Attempt to unbreak INDEX, bsd.ocaml.mk moved to Mk/pav2008-04-071-1/+0
* - Welcome X.org 7.2 \o/.flz2007-05-201-0/+1