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

Stefan Fritsch sf at sfritsch.de
Tue Mar 20 20:08:07 UTC 2012


The following commit has been merged in the next branch:
commit 7d5931480bbe3fcd1cc9d521787e28755e70f9b2
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Tue Mar 20 21:07:37 2012 +0100

    Make autoscripts only run on upgrades by default.
    
    Also: Bump debhelper dependency of apache2-dev.
    Escape slashes in conditionals.

diff --git a/debian/changelog b/debian/changelog
index 57e33af..1692260 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,16 @@
-apache2 (2.4.1-2) experimental; urgency=low
+apache2 (2.4.1-2) UNRELEASED; urgency=low
 
+  [ Arno Töll ]
   * Shift convert_docs script to a arch-indep target only. Debhelper does not
     build apache2-doc on binary only builds causing a FTBS on binary-only (-B)
     builds
   * Raise debhelper build-dependency to 8.9.7~ due to the use of arch-indep
     targets
 
+  [ Stefan Fritsch ]
+  * dh_apache2: Make autoscripts only run on upgrades by default. Bump
+    debhelper dependency of apache2-dev. Escape slashes in conditionals.
+
  -- Arno Töll <debian at toell.net>  Tue, 20 Mar 2012 11:15:14 +0100
 
 apache2 (2.4.1-1) experimental; urgency=low
diff --git a/debian/control b/debian/control
index 7c39d0a..e227224 100644
--- a/debian/control
+++ b/debian/control
@@ -165,7 +165,7 @@ Description: Apache HTTP Server (on-site documentation)
 Package: apache2-dev
 Architecture: any
 Depends: ${misc:Depends}, apache2 (= ${binary:Version}), openssl,
- libapr1-dev, libaprutil1-dev, debhelper (>= 7.0.50~), ${perl:Depends}
+ libapr1-dev, libaprutil1-dev, debhelper (>= 9.20120311~), ${perl:Depends}
 Provides: apache2-prefork-dev, apache2-threaded-dev, dh-apache2
 Replaces: apache2-prefork-dev, apache2-threaded-dev
 Conflicts: apache2-prefork-dev, apache2-threaded-dev
diff --git a/debian/debhelper/dh_apache2.in b/debian/debhelper/dh_apache2.in
index 36959a7..c116273 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<true> and is subject to shell expansion (see Debian bug #660794 or
+Defaults to B<test -n "$2"> 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.
@@ -293,7 +293,7 @@ init(options => {
 
 if (!$dh{CONDITIONAL})
 {
-	$dh{CONDITIONAL} = "true";
+	$dh{CONDITIONAL} = 'test -n "$2"';
 }
 
 foreach my $package (getpackages())
@@ -472,9 +472,23 @@ foreach my $package (getpackages())
 	{
 		foreach my $ref (@postinst_autoscripts)
 		{
-			autoscript($package, "postinst", "postinst-apache2", "s/#HELPER#/$ref->[0]/; s/#NAMES#/$ref->[1]/; s/#ERROR_HANDLER#/$PACKAGE_TYPE{'handler'}/; s/#CONDITIONAL_VARIABLE#/$PACKAGE_TYPE{'conditional'}/;");
+			my %replacements = (
+				HELPER => $ref->[0],
+				NAMES  => $ref->[1],
+				ERROR_HANDLER => $PACKAGE_TYPE{handler},
+				CONDITIONAL_VARIABLE => $PACKAGE_TYPE{conditional},
+			);
+			my $sed_command = "";
+			foreach my $key (sort keys %replacements) {
+				my $val = $replacements{$key};
+				# escape slashes and backslashes from sed
+				$val =~ s,([/\\]),\\$1,g;
+				$sed_command .= "s/#$key#/$val/g; ";
+			}
+
+			autoscript($package, "postinst", "postinst-apache2", $sed_command);
 			$ref->[0] =~ s/en/dis/;
-			autoscript($package, "postrm", "postrm-apache2", "s/#HELPER#/$ref->[0]/; s/#NAMES#/$ref->[1]/; s/#ERROR_HANDLER#/$PACKAGE_TYPE{'handler'}/; s/#CONDITIONAL_VARIABLE#/$PACKAGE_TYPE{'conditional'}/;");
+			autoscript($package, "postrm", "postrm-apache2", $sed_command);
 		}
 	}
 }

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



More information about the Pkg-apache-commits mailing list