[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.47-40-g31a624f

Andreas Beckmann debian at abeckmann.de
Thu Nov 29 15:29:25 UTC 2012


The following commit has been merged in the develop branch:
commit 31a624f93b017e459984d014402bf92e4a9723a5
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Tue Nov 6 10:12:56 2012 +0100

    slave_cleanup: restrict cleanup to directories with .piuparts.tmpdir
    
    do not go havoc if tmpdir is not private to piuparts, e.g. /tmp or /var/tmp
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 70cbf65..8d87bee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,7 @@ piuparts (0.48) UNRELEASED; urgency=low
     the package currently untestable. Deleting the log will cause the package
     to be moved to dependency-failed-testing or similar state.
     expire-*-days needs to be greater than reschedule-*-days to enable this.
+  * slave_cleanup: Only remove directories containing a .piuparts.tmpdir file.
   * New bug template: copyright_file_missing_after_upgrade.
   * New known problem: Installing something over existing symlinks.
 
diff --git a/slave-bin/slave_cleanup b/slave-bin/slave_cleanup
index 6b7f6bc..5a80b92 100755
--- a/slave-bin/slave_cleanup
+++ b/slave-bin/slave_cleanup
@@ -1,4 +1,5 @@
 #!/bin/sh
+set -e
 
 # Copyright 2012 Holger Levsen (holger at layer-acht.org)
 #
@@ -21,10 +22,9 @@
 #
 # - this should only be run (automatically) on boot
 #
-set -e
 
 # do nothing if piuparts-slave is running
-if [ "$(ps fax|grep piuparts-slave|grep -v grep)" != "" ] ; then
+if [ "$(ps fax|grep share/piuparts/piuparts-slave|grep -v grep)" != "" ] ; then
 	exit 0
 fi
 
@@ -58,6 +58,11 @@ do
 done
 
 # cleanup tmp
-sudo rm -rf --one-file-system "$PIUPARTS_TMPDIR"
 mkdir -p "$PIUPARTS_TMPDIR"
-
+for dir in $(ls -d1 "$PIUPARTS_TMPDIR"/*/ 2>/dev/null || true)
+do
+	if sudo test -f "$dir/.piuparts.tmpdir"; then
+		sudo rm -rf --one-file-system "$dir"
+		test ! -d "$dir" || sudo touch "$dir/.piuparts.tmpdir"
+	fi
+done

-- 
piuparts git repository



More information about the Piuparts-commits mailing list