From 1fef98d4034c22d35d3fee00d62c3ad15f930b20 Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Wed, 8 Jul 2009 14:13:58 -0500 Subject: added contrib/mock-cleanup script --- contrib/mock-cleanup | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 contrib/mock-cleanup diff --git a/contrib/mock-cleanup b/contrib/mock-cleanup new file mode 100755 index 0000000..bf31f30 --- /dev/null +++ b/contrib/mock-cleanup @@ -0,0 +1,30 @@ +#! /bin/sh +# +# mock-cleanup +# +# clean packages in mock's cache directories +# + +NEWCACHEDIR=/var/cache/mock +OLDCACHEDIR=/var/lib/mock/cache + +dirs= +for d in $NEWCACHEDIR $OLDCACHEDIR +do + if [ -d $d -a ! -z "$d/*/yum_cache" ] + then + dirs="$dirs $d/*/yum_cache" + fi +done + +for d in $dirs +do + echo -n "Clean in $d:" + cd $d + for r in */packages + do + echo -n " `dirname $r`" + repomanage --old --nocheck $r 2>/dev/null | xargs --no-run-if-empty rm + done + echo " done" +done -- cgit