[SCM] Debian packaging for apache2 branch, next, updated. debian/2.4.4-2-14-gfe499ed

Arno Töll arno at debian.org
Mon May 20 12:21:16 UTC 2013


The following commit has been merged in the next branch:
commit bad5e781e7ae521c5cc1b82d61049a6860c3b9bc
Author: Arno Töll <arno at debian.org>
Date:   Mon May 20 13:50:02 2013 +0200

    Hook dh_apache2 into postrm and prem
    Purge state in postrm only
    Let a2enmod purge state when calling -p for disabled modules

diff --git a/debian/a2enmod b/debian/a2enmod
index 1600790..dd953e0 100755
--- a/debian/a2enmod
+++ b/debian/a2enmod
@@ -280,6 +280,9 @@ sub doit {
         }
         else {
             info("$name $acton already disabled\n");
+            if ( $purge ) {
+                switch_marker( $obj, $act, $acton );
+            }
             return 1;
         }
     }
diff --git a/debian/apache2-dev.install b/debian/apache2-dev.install
index 2f628cd..eacb880 100644
--- a/debian/apache2-dev.install
+++ b/debian/apache2-dev.install
@@ -5,3 +5,4 @@ debian/debhelper/dh_apache2		/usr/bin
 debian/debhelper/apache2.pm		/usr/share/perl5/Debian/Debhelper/Sequence/
 debian/debhelper/postinst-apache2	/usr/share/debhelper/autoscripts/
 debian/debhelper/prerm-apache2		/usr/share/debhelper/autoscripts/
+debian/debhelper/postrm-apache2		/usr/share/debhelper/autoscripts/
diff --git a/debian/changelog b/debian/changelog
index c1737bc..c58bc4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,8 +10,11 @@ apache2 (2.4.4-3) UNRELEASED; urgency=low
   * Changes in dh_apache2:
     + Add -e|--noenable option to dh_apache2 (Closes: #681544)
     + Disable scripts in prerm, not postrm (Closes: #681546)
+    + However, still hook into postrm and purge state when required
     + Call the postinst code always, not only during configure
       (Closes: #681545)
+  * Let a2enmod purge state when calling -p for already disabled
+    configurations.
   * Fix "don't assume apache2 is running 24 hours a day when rotating
     logs": Only restart the webserver when it was previously running
     (Closes: #707892)
@@ -30,7 +33,7 @@ apache2 (2.4.4-3) UNRELEASED; urgency=low
     fixed in 2.4.
   * Enable mod_authn_core when upgrading from wheezy (Closes: #702866)
 
- -- Arno Töll <arno at debian.org>  Tue, 14 May 2013 19:15:12 +0200
+ -- Arno Töll <arno at debian.org>  Mon, 20 May 2013 13:14:12 +0200
 
 apache2 (2.4.4-2) experimental; urgency=low
 
diff --git a/debian/debhelper/apache2-maintscript-helper b/debian/debhelper/apache2-maintscript-helper
index e78a5de..14a8908 100644
--- a/debian/debhelper/apache2-maintscript-helper
+++ b/debian/debhelper/apache2-maintscript-helper
@@ -363,16 +363,31 @@ apache2_invoke()
 			apache2_msg "info" "apache2_invoke: Enable $invoke_string $CONF"
 			;;
 		disconf|dismod|dissite)
-			if a2query $check_switch $CONF > /dev/null 2>&1 ; then
+			local a2query_ret=0
+			a2query $check_switch "$CONF" > /dev/null 2>&1 || a2query_ret=$?
+			if [ "$a2query_ret" -eq 0 ] ; then
 				if [ "$APACHE2_MAINTSCRIPT_NAME" = 'postrm' ] && [ "$APACHE2_MAINTSCRIPT_METHOD" = "purge" ] ; then
 					a2$CMD -p -f -q "$CONF" || return 1
+					apache2_msg "info" "apache2_invoke $APACHE2_MAINTSCRIPT_NAME: Purging $invoke_string $CONF"
+					APACHE2_NEED_ACTION=1
+				elif [ "$APACHE2_MAINTSCRIPT_NAME" = 'postrm' ] || [ "$APACHE2_MAINTSCRIPT_NAME" = 'prerm' ] ; then
+					if [ "$APACHE2_MAINTSCRIPT_METHOD" = "remove" ] ; then
+						a2$CMD -m -f -q "$CONF" || return 1
+						apache2_msg "info" "apache2_invoke $APACHE2_MAINTSCRIPT_NAME: Disable $invoke_string $CONF"
+						APACHE2_NEED_ACTION=1
+					fi
 				else
-					a2$CMD -m -f -q "$CONF" || return 1
+					apache2_msg "error" "apache2_invoke: $invoke_string $CONF not supported in $APACHE2_MAINTSCRIPT_NAME"
+					return 1
+				fi
+			elif [ "$a2query_ret" -eq 33 ] ; then
+				if [ "$APACHE2_MAINTSCRIPT_NAME" = 'postrm' ] && [ "$APACHE2_MAINTSCRIPT_METHOD" = "purge" ] ; then
+					apache2_msg "info" "apache2_invoke $APACHE2_MAINTSCRIPT_NAME: Purging state for $CONF"
+					a2$CMD -p -f -q "$CONF" || return 1
+					APACHE2_NEED_ACTION=0
 				fi
-				APACHE2_NEED_ACTION=1
-				apache2_msg "info" "apache2_invoke: Disable $invoke_string $CONF"
 			else
-				apache2_msg "info" "apache2_invoke $CONF: No action required"
+				apache2_msg "info" "apache2_invoke $CONF $APACHE2_MAINTSCRIPT_NAME: No action required"
 			fi
 			;;
 		*)
diff --git a/debian/debhelper/dh_apache2.in b/debian/debhelper/dh_apache2.in
index 18f78bd..293da12 100755
--- a/debian/debhelper/dh_apache2.in
+++ b/debian/debhelper/dh_apache2.in
@@ -498,7 +498,7 @@ foreach my $package ((@{$dh{DOPACKAGES}}))
 	{
 		foreach my $ref (@postinst_autoscripts)
 		{
-			for my $script_type (qw/postinst prerm/)
+			for my $script_type (qw/postinst prerm postrm/)
 			{
 				if ($script_type eq "postinst" &&  $dh{NOENABLE})
 				{
@@ -513,7 +513,7 @@ foreach my $package ((@{$dh{DOPACKAGES}}))
 					ACTION => $dh{RESTART},
 				);
 
-				if ($script_type eq "prerm")
+				if ($script_type eq "prerm" || $script_type eq "postrm")
 				{
 					$replacements{'HELPER'} =~ s/en/dis/;
 				}
diff --git a/debian/debhelper/prerm-apache2 b/debian/debhelper/postrm-apache2
similarity index 81%
copy from debian/debhelper/prerm-apache2
copy to debian/debhelper/postrm-apache2
index d71d36b..89ee460 100644
--- a/debian/debhelper/prerm-apache2
+++ b/debian/debhelper/postrm-apache2
@@ -1,4 +1,4 @@
-if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
+if [ "$1" = "purge" ] ; then
 	if #CONDITIONAL_VARIABLE#; then
 		if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
 			. /usr/share/apache2/apache2-maintscript-helper

-- 
Debian packaging for apache2



More information about the Pkg-apache-commits mailing list