summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-02-20 21:32:28 +0100
committerHolger Levsen <holger@layer-acht.org>2015-02-20 21:32:28 +0100
commite255215fc7ca1d020632cc4b63950277db2eefaa (patch)
tree4526fa4ec2c168b00541af3514ec87e8106eb0e3
parent54b9e565013fb7e572fd12fe8b10314eeb07e05d (diff)
downloadjenkins.debian.net-e255215fc7ca1d020632cc4b63950277db2eefaa.tar.xz
reproducible: start to automatically cleanup pbuild leftovers
-rwxr-xr-xbin/reproducible_maintainance.sh24
1 files 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