[pkg-java] r2788 - branches/tomcat5.5/feature/debian/debian

Marcus Better marcusb-guest at alioth.debian.org
Wed Nov 22 20:08:47 CET 2006


Author: marcusb-guest
Date: 2006-11-22 20:08:47 +0100 (Wed, 22 Nov 2006)
New Revision: 2788

Modified:
   branches/tomcat5.5/feature/debian/debian/tomcat5.5.postrm
Log:
Check that tomcat5 user exists before removing it. Remove a bashism.


Modified: branches/tomcat5.5/feature/debian/debian/tomcat5.5.postrm
===================================================================
--- branches/tomcat5.5/feature/debian/debian/tomcat5.5.postrm	2006-11-22 18:44:42 UTC (rev 2787)
+++ branches/tomcat5.5/feature/debian/debian/tomcat5.5.postrm	2006-11-22 19:08:47 UTC (rev 2788)
@@ -10,14 +10,15 @@
         # Remove user and log files (don't remove everything under
 	# /var/lib/tomcat5.5 because there might be user-installed webapps)
 	userdel tomcat55 || true
-	rm -rf /var/log/tomcat5.5 /var/cache/tomcat5.5 /var/lib/tomcat5.5/{conf,temp}
+	rm -rf /var/log/tomcat5.5 /var/cache/tomcat5.5 \
+	    /var/lib/tomcat5.5/conf /var/lib/tomcat5.5/temp
 	rmdir --ignore-fail-on-non-empty /var/lib/tomcat5.5 || true
 	rmdir --ignore-fail-on-non-empty /etc/tomcat5.5/policy.d /etc/tomcat5.5 || true
-    # remove user tomcat5 if package tomcat5 is 
+    # remove user tomcat5 if it exists, and package tomcat5 is 
     # marked as purged or has never been installed
     if [ -n "$(dpkg -l tomcat5 | grep pn)" -o -n "$(dpkg -l tomcat5 | grep un)" ]
     then
-	userdel tomcat5 || true
+	(id tomcat5 > /dev/null 2>&1  && userdel tomcat5) || true
     fi
 
     ;;




More information about the pkg-java-commits mailing list