diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-02-20 21:32:28 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-02-20 21:32:28 +0100 |
commit | e255215fc7ca1d020632cc4b63950277db2eefaa (patch) | |
tree | 4526fa4ec2c168b00541af3514ec87e8106eb0e3 /bin | |
parent | 54b9e565013fb7e572fd12fe8b10314eeb07e05d (diff) | |
download | jenkins.debian.net-e255215fc7ca1d020632cc4b63950277db2eefaa.tar.xz |
reproducible: start to automatically cleanup pbuild leftovers
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_maintainance.sh | 24 |
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 |