[Pkg-apache-commits] [SCM] Debian packaging for apache2 (Apache HTTPD 2.x) branch, next, updated. c2896e13ae967be5c1e0d04acd74b78ea8124025

Stefan Fritsch sf at sfritsch.de
Sat Mar 31 21:19:41 UTC 2012


The following commit has been merged in the next branch:
commit 872a7f536fd59853db8efdc7de7bc45e30c68f2c
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Sat Mar 31 22:51:12 2012 +0200

    this is more readable if we use a case

diff --git a/debian/debhelper/apache2-maintscript-helper b/debian/debhelper/apache2-maintscript-helper
index d619bfa..0ab08a4 100644
--- a/debian/debhelper/apache2-maintscript-helper
+++ b/debian/debhelper/apache2-maintscript-helper
@@ -129,30 +129,29 @@ apache2_needs_action()
 	#	- disable the configuration, mark it as automatically disabled in remove
 	#	- disable the configuration, remove any trace we have on purge
 
-	if [ -z "$APACHE2_MAINTSCRIPT_NAME" ] ; then
-		return 1
-	fi
-
-	if [ "$APACHE2_MAINTSCRIPT_NAME" = 'preinst' ] ; then
+	case "$APACHE2_MAINTSCRIPT_NAME" in
+	preinst)
 		apache2_msg "info" "apache2_needs_action: The maintainer helper can not be called in preinst"
 		return 1
-	fi
-
-	if [ "$APACHE2_MAINTSCRIPT_NAME" = 'prerm' ] || [ "$APACHE2_MAINTSCRIPT_NAME" = 'postrm' ] ; then
+		;;
+	prerm|postrm)
 		case "$APACHE2_MAINTSCRIPT_METHOD" in
-			remove|purge)
-				return 0
-				;;
-			*)
-				return 1
-				;;
+		remove|purge)
+			return 0
+			;;
+		*)
+			return 1
+			;;
 		esac
-	fi
-
-	if [ "$APACHE2_MAINTSCRIPT_NAME" = 'postinst' ] && [ "$APACHE2_MAINTSCRIPT_METHOD" = "configure" ] && \
-		[ -z "$APACHE2_MAINTSCRIPT_ARGUMENT" ] ; then
+		;;
+	postinst)
+		if [ "$APACHE2_MAINTSCRIPT_METHOD" = "configure" ] && \
+		   [ -z "$APACHE2_MAINTSCRIPT_ARGUMENT" ]
+		then
 			return 0
-	fi
+		fi
+		;;
+	esac
 
 	return 1
 }

-- 
Debian packaging for apache2 (Apache HTTPD 2.x)



More information about the Pkg-apache-commits mailing list