[Python-apps-commits] r7014 - in packages/slapos.tool.format/trunk/debian (postrm)

arnau at users.alioth.debian.org arnau at users.alioth.debian.org
Fri Apr 29 10:04:04 UTC 2011


    Date: Friday, April 29, 2011 @ 10:03:52
  Author: arnau
Revision: 7014

Clean up postrm

Modified:
  packages/slapos.tool.format/trunk/debian/postrm

Modified: packages/slapos.tool.format/trunk/debian/postrm
===================================================================
--- packages/slapos.tool.format/trunk/debian/postrm	2011-04-29 10:02:19 UTC (rev 7013)
+++ packages/slapos.tool.format/trunk/debian/postrm	2011-04-29 10:03:52 UTC (rev 7014)
@@ -2,26 +2,25 @@
 set -e
 
 CONFIG_DIR="/etc/slapos"
+LOG_DIR="/var/log/slapos"
 
 case "$1" in
     purge)
 	if [ -d "$CONFIG_DIR" ]; then
-	    rm -f "$CONFIG_DIR"/slapos.cfg
-	    test -d /etc/slapos/ssl/ && rm -rf /etc/slapos/ssl/
-	    [ $(ls "$CONFIG_DIR" | wc -l) -eq 0 ] && rmdir "$CONFIG_DIR"
+	    /bin/rm -f "${CONFIG_DIR}/slapos.cfg"
+	    test -d "${CONFIG_DIR}/ssl/" && /bin/rm -rf "${CONFIG_DIR}/ssl/"
+	    [ $(/bin/ls "$CONFIG_DIR" | wc -l) -eq 0 ] && /bin/rmdir "$CONFIG_DIR"
 	fi
 
 	test -d /var/cache/slapos/certificates/ && \
-	    rm -rf /var/cache/slapos/certificates
+	    /bin/rm -rf /var/cache/slapos/certificates
 
-	if [ -d "/var/log/slapos" ]; then
-	    test -f /var/log/slapos/slapformat.log && rm -f /var/log/slapos/slapformat.log
-	    [ $(ls /var/log/slapos/ | wc -l) -eq 0 ] && rmdir /var/log/slapos/
+	if [ -d "$LOG_DIR" ]; then
+	    test -f "${LOG_DIR}/slapformat.log" && /bin/rm -f "${LOG_DIR}/slapformat.log"
+	    [ $(/bin/ls "$LOG_DIR" | wc -l) -eq 0 ] && /bin/rmdir "$LOG_DIR"
 	fi
 
-	if [ -d "/var/lib/slapos" ]; then
-	    rm -rf /var/lib/slapos/
-	fi
+	test -d /var/lib/slapos && /bin/rm -rf /var/lib/slapos/
 	;;
 esac
 




More information about the Python-apps-commits mailing list