From e255215fc7ca1d020632cc4b63950277db2eefaa Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 20 Feb 2015 21:32:28 +0100 Subject: reproducible: start to automatically cleanup pbuild leftovers --- bin/reproducible_maintainance.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/bin/reproducible_maintainance.sh b/bin/reproducible_maintainance.sh index d8e71d82..bbffa231 100755 --- a/bin/reproducible_maintainance.sh +++ b/bin/reproducible_maintainance.sh @@ -59,12 +59,26 @@ if [ ! -z "$OLDSTUFF" ] ; then fi # find and warn about pbuild leftovers -OLDSTUFF=$(find /var/cache/pbuilder/result/ -mtime +0 -exec ls -lad {} \;) +OLDSTUFF=$(find /var/cache/pbuilder/result/ -mtime +1 -exec ls -lad {} \;) if [ ! -z "$OLDSTUFF" ] ; then - echo - echo "Warning: old files or directories found in /var/cache/pbuilder/result/" - echo "$OLDSTUFF" - echo "Please cleanup manually." + # delete known files + echo "Attempting file detection..." + cd /var/cache/pbuilder/result/ + for i in $(find . -maxdepth 1 -mtime +1 -type f) ; do + case $i in + stderr|stdout) rm -v $i + ;; + *) ;; + esac + done + cd - + # report the rest + OLDSTUFF=$(find /var/cache/pbuilder/result/ -mtime +1 -exec ls -lad {} \;) + if [ ! -z "$OLDSTUFF" ] ; then + echo "Warning: old files or directories found in /var/cache/pbuilder/result/" + echo "$OLDSTUFF" + echo "Please cleanup manually." + fi echo DIRTY=true fi -- cgit v1.2.3-70-g09d2