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

Arno Töll debian at toell.net
Sun Mar 25 22:46:00 UTC 2012


The following commit has been merged in the next branch:
commit b4d5281a59c0bd4338d1049f6ec27add137fb11f
Author: Arno Töll <debian at toell.net>
Date:   Mon Mar 26 00:44:37 2012 +0200

    * accept a single configuration in apache2_invoke only (BREAKS APIS)
    * Fix a double escape bug in the sed wrapper for dh_apache2
    * Update dh_apache2 to work with the new apache2_invoke calling conventions

diff --git a/debian/changelog b/debian/changelog
index 14d6ff3..8cdaa15 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,12 +19,15 @@ apache2 (2.4.1-3) experimental; urgency=low
       functions
     + Parse maintainer script arguments to find out which script called us
     + Support APACHE2_MAINTSCRIPT_HELPER_QUIET which, when set, omits any visible output
+    + Break APIs: apache2_invoke accepts a single configuration file argument
+      only now. However, other than dh_apache2 no users of this feature were
+      known.
 
   [ Stefan Fritsch ]
   * Move /usr/share/doc alias to separate config file and don't enable it
     by default.
 
- -- Arno Töll <debian at toell.net>  Sun, 25 Mar 2012 23:31:09 +0200
+ -- Arno Töll <debian at toell.net>  Mon, 26 Mar 2012 00:43:38 +0200
 
 apache2 (2.4.1-2) experimental; urgency=low
 
diff --git a/debian/debhelper/apache2-maintscript-helper b/debian/debhelper/apache2-maintscript-helper
index fb88730..f10931b 100644
--- a/debian/debhelper/apache2-maintscript-helper
+++ b/debian/debhelper/apache2-maintscript-helper
@@ -62,14 +62,6 @@ fi
 # purge should then do
 # rm -f /var/lib/apache2/modules_disabled_by_maintscript/$module
 # in addition.
-#
-# And even more work:
-# - change the API of apache2_invoke to be more easily extensible (maybe only one
-#   module/conf per invocation, this would allow adding optional parameters later)
-# - change dh_apache2 accordingly (which is not that trivial as there is no easy
-#   way to source script fragments in autoscripts)
-
-
 
 
 #
@@ -255,17 +247,18 @@ apache2_switch_mpm()
 # Parameters:
 #	command - The command to invoke. Recognized commands are "enconf",
 #		"enmod", "ensite", "disconf", "dismod", "dissite"
-#	arguments - A variable number or arguments (e.g. modules) which shall be
+#	argument - A single argument (e.g. a module) which shall be
 #		enabled or disabled respectively. Do not enable module
 #		dependencies that way, instead use module dependencies as
 #		documented in </usr/share/doc/apache2/PACKAGING>.
 # Returns:
 #	0 if the changes could be activated
 #	1 otherwise
-# Since: 2.4.1-1
+# Since: 2.4.1-3
 apache2_invoke()
 {
 	local CMD=$1
+	local CONF=$2
 	shift
 	local invoke_rcd=0
 	local check_switch=""
@@ -296,30 +289,28 @@ apache2_invoke()
 			;;
 	esac
 
-	for CONF in $@ ; do
-		case "$CMD" in
-			enconf|enmod|ensite)
-				if a2query $check_switch $CONF > /dev/null 2>&1 ; then
-					continue
-				fi
+	case "$CMD" in
+		enconf|enmod|ensite)
+			if a2query $check_switch $CONF > /dev/null 2>&1 ; then
+				continue
+			fi
+			invoke_rcd=1
+			a2$CMD -q "$CONF" > /dev/null 2>&1 || return 1
+			apache2_msg "info" "apache2_invoke: Enable $invoke_string $CONF"
+			;;
+		disconf|dismod|dissite)
+			if a2query $check_switch $CONF > /dev/null 2>&1 ; then
 				invoke_rcd=1
 				a2$CMD -q "$CONF" > /dev/null 2>&1 || return 1
-				apache2_msg "info" "apache2_invoke: Enable $invoke_string $CONF"
-				;;
-			disconf|dismod|dissite)
-				if a2query $check_switch $CONF > /dev/null 2>&1 ; then
-					invoke_rcd=1
-					a2$CMD -q "$CONF" > /dev/null 2>&1 || return 1
-					apache2_msg "info" "apache2_invoke: Disable $invoke_string $CONF"
-				else
-					continue
-				fi
-				;;
-			*)
-				return 1
-				;;
-		esac
-	done
+				apache2_msg "info" "apache2_invoke: Disable $invoke_string $CONF"
+			else
+				continue
+			fi
+			;;
+		*)
+			return 1
+			;;
+	esac
 
 	if [ $invoke_rcd -eq 1 ] ; then
 		apache2_reload
diff --git a/debian/debhelper/dh_apache2.in b/debian/debhelper/dh_apache2.in
index b79dda4..c871ae2 100755
--- a/debian/debhelper/dh_apache2.in
+++ b/debian/debhelper/dh_apache2.in
@@ -228,7 +228,7 @@ true value at installation time. This is useful to web applications which want
 to install Apache configuration files depending on a user input, for example if
 they interface to the user through L<debconf(1)>.
 
-Defaults to B<test -n "$2"> and is subject to shell expansion (see Debian bug #660794 or
+Defaults to B<true> and is subject to shell expansion (see Debian bug #660794 or
 build-depend on debhelper >= 9.20120311 to avoid this problem). The expression
 should be provided in the postrm and postinst scripts before the B<#DEBHELPER#>
 token.
@@ -491,7 +491,7 @@ foreach my $package (getpackages())
 				{
 					my $val = $replacements{$key};
 					# escape slashes and backslashes from sed
-					$val =~ s,([/\\]),\\$1,g;
+					$val =~ s,([/\\]),\$1,g;
 					$sed_command .= "s/#$key#/$val/g; ";
 				}
 
diff --git a/debian/debhelper/postinst-apache2 b/debian/debhelper/postinst-apache2
index f7afc4d..4f4e9b2 100644
--- a/debian/debhelper/postinst-apache2
+++ b/debian/debhelper/postinst-apache2
@@ -1,6 +1,8 @@
 if [ "$1" = "configure" ] && #CONDITIONAL_VARIABLE#; then
 	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
 		. /usr/share/apache2/apache2-maintscript-helper
-		apache2_invoke #HELPER# #NAMES# || #ERROR_HANDLER#
+		for conf in #NAMES# ; do
+			apache2_invoke #HELPER# $conf || #ERROR_HANDLER#
+		done
 	fi
 fi
diff --git a/debian/debhelper/postrm-apache2 b/debian/debhelper/postrm-apache2
index e3bc890..ce8add8 100644
--- a/debian/debhelper/postrm-apache2
+++ b/debian/debhelper/postrm-apache2
@@ -2,7 +2,10 @@ if [ "$1" = "purge" ] || [ "$1" = "remove" ] ; then
 	if #CONDITIONAL_VARIABLE#; then
 		if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
 			. /usr/share/apache2/apache2-maintscript-helper
-			apache2_invoke #HELPER# #NAMES# || #ERROR_HANDLER#
+
+			for conf in #NAMES# ; do
+				apache2_invoke #HELPER# $conf || #ERROR_HANDLER#
+			done
 		fi
 	fi
 fi

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



More information about the Pkg-apache-commits mailing list