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

Arno Töll debian at toell.net
Wed Feb 29 02:47:55 UTC 2012


The following commit has been merged in the next branch:
commit 85f85e0c0897ceb2e3c6d1ce1e8fece033ae48ac
Author: Arno Töll <debian at toell.net>
Date:   Wed Feb 29 03:47:29 2012 +0100

    Do a proper transition of httpd.conf if it exists

diff --git a/debian/apache2.postinst b/debian/apache2.postinst
index afd8a25..3b60f49 100755
--- a/debian/apache2.postinst
+++ b/debian/apache2.postinst
@@ -153,6 +153,8 @@ enable_default_mpm()
 
                         apache2-mpm-itk)
                                 # Houston, we got a problem
+				# XXX: Maybe display a big warning?
+				mpm="mpm_prefork"
                         ;;
 
                         *)
@@ -245,9 +247,26 @@ refresh_modules()
         fi
 }
 
+move_httpd_conf()
+{
+        if we_are_upgrading_from_squeeze $@ ; then
+		if [ -e /etc/apache2/httpd.conf ] && [ -f /etc/apache2/httpd.conf ] ; then
+			local md5sum="$(md5sum /etc/apache2/httpd.conf | sed -e 's/ .*//')"
+			if [ $md5sum = "d41d8cd98f00b204e9800998ecf8427e" ] ;	then
+				echo "Remove obsolete configuration file /etc/apache2/httpd.conf"
+				rm -f /etc/apache2/httpd.conf
+			else
+				if [ -d /etc/apache2/conf-available/ ] && [ ! -f /etc/apache2/conf-available/httpd.conf ] ; then
+					echo "Detected legacy httpd.conf - moving file to /etc/apache2/conf-available/httpd.conf"
+					mv /etc/apache2/httpd.conf /etc/apache2/conf-available/httpd.conf
+					a2enconf -q httpd
+				fi
+			fi
+		fi
+	fi
+}
+
 #XXX: Move /var/cache/apache2/mod_disk_cache to /var/cache/apache2/mod_cache_disk?
-#XXX: Move httpd.conf into conf.d if not empty, add comment what it used to be.
-#     Otherwise delete it
 #XXX: Deal with the sites-available/sites-enabled *.conf transition, e.g. rename
 #     all files which look like site configuration? 
 
@@ -262,6 +281,7 @@ case "$1" in
                 enable_default_modules $@
 		enable_default_conf $@
                 install_default_site $@
+		move_httpd_conf $@
 
                 # post installation cleanup
                 if [ -e /etc/apache2/.apache2_mpm_selected ] ; then

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



More information about the Pkg-apache-commits mailing list