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

Stefan Fritsch sf at sfritsch.de
Sun Mar 18 20:57:33 UTC 2012


The following commit has been merged in the next branch:
commit d02d5fb331095f0d8e703a814a0830315d85f76c
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Sun Mar 18 21:55:29 2012 +0100

    apache2-maintscript-helper improvements
    
    - put EXPORT_APACHE2_MAINTSCRIPT_HELPER check inside helper
    - some docs tweaks

diff --git a/debian/PACKAGING b/debian/PACKAGING
index 32815e6..e973f32 100644
--- a/debian/PACKAGING
+++ b/debian/PACKAGING
@@ -169,8 +169,8 @@ apache2-maintscript-helper
 --------------------------
 
 The apache2-maintscript-helper is a collection of functions which can be
-sourced in maintainer scripts to do often required tasks in a simple and
-standardized way to package maintainers. It is NOT a script, it is a library
+sourced in maintainer scripts to do required tasks in a simple and
+standardized way. It is NOT a script, it is a library
 (insofar shell functions can be called as such). The helper is installed within
 the apache2 binary package. Thus you MUST NOT use any function of it
 unconditionally, as for both modules and web applications there are use cases
@@ -182,21 +182,16 @@ conditional like this only:
 		<call apache2-maintscript-helper specific functions>
 	fi
 
-If you use various debhelper, chances are the apache2-maintscript-helper was
-already sourced. In such cases you can check the
-$EXPORT_APACHE2_MAINTSCRIPT_HELPER variable which is defined once the helper was
-loaded. For example in a clause like this:
-
-	if [ -z "$EXPORT_APACHE2_MAINTSCRIPT_HELPER" ] ; then
-		. /usr/share/apache2/apache2-maintscript-helper
-	fi
-
-The helper provides functions to enable and disable configuration files, restart
-the web server, switch the MPM in use and similar. Refer to the source code for
-detailed interface documentation. When available, please use the
+The helper provides functions to enable and disable configuration files,
+restart the web server, switch the MPM in use and similar. Refer to the source
+code for detailed interface documentation. When available, please use the
 apache2-maintscript-helper instead of calling helper scripts directly, as these
-functions are careful to invoke and use particular helper. Always check the
-return code of the called function to find out whether something went wrong:
+functions are careful to invoke and use particular helper. Later versions may
+be configurable to allow the administrator to influence which actions are
+preformed.
+
+Always check the return code of the called function to find out whether
+something went wrong:
 
 	if ! apache2_invoke enmod modulename ; then
 		echo "Whoops! Something went wrong"
@@ -222,7 +217,7 @@ directly, instead it is recommended to use apache2-maintscript-helper. For
 detailed usage refer to their respective man pages.
 
 a2query
-------
+-------
 
 a2query is a query tool to retrieve runtime status information about the Apache
 2 web server instance. You can use this tool to get information about loaded
diff --git a/debian/debhelper/apache2-maintscript-helper b/debian/debhelper/apache2-maintscript-helper
index 679175f..a89b4c1 100644
--- a/debian/debhelper/apache2-maintscript-helper
+++ b/debian/debhelper/apache2-maintscript-helper
@@ -18,6 +18,9 @@
 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+if [ -z "${EXPORT_APACHE2_MAINTSCRIPT_HELPER:-} ] ; then
+	return
+fi
 EXPORT_APACHE2_MAINTSCRIPT_HELPER=1
 
 #
@@ -68,7 +71,7 @@ apache2_switch_mpm()
 		return 1
 	fi
 
-	CUR_MPM=$(a2query -M) || return 1
+	local CUR_MPM=$(a2query -M) || return 1
 
 	if [ $CUR_MPM != $MPM ] ; then
 		a2dismod -q "mpm_$CUR_MPM";
diff --git a/debian/debhelper/postinst-apache2 b/debian/debhelper/postinst-apache2
index 24a7a85..f7afc4d 100644
--- a/debian/debhelper/postinst-apache2
+++ b/debian/debhelper/postinst-apache2
@@ -1,8 +1,6 @@
 if [ "$1" = "configure" ] && #CONDITIONAL_VARIABLE#; then
 	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
-		if [ -z $EXPORT_APACHE2_MAINTSCRIPT_HELPER ] ; then
-			. /usr/share/apache2/apache2-maintscript-helper
-		fi
+		. /usr/share/apache2/apache2-maintscript-helper
 		apache2_invoke #HELPER# #NAMES# || #ERROR_HANDLER#
 	fi
 fi
diff --git a/debian/debhelper/postrm-apache2 b/debian/debhelper/postrm-apache2
index 207ba88..27bbef6 100644
--- a/debian/debhelper/postrm-apache2
+++ b/debian/debhelper/postrm-apache2
@@ -1,8 +1,6 @@
 if [ "$1" = "purge" ] && #CONDITIONAL_VARIABLE#; then
 	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
-		if [ -z $EXPORT_APACHE2_MAINTSCRIPT_HELPER ] ; then
-			. /usr/share/apache2/apache2-maintscript-helper
-		fi
+		. /usr/share/apache2/apache2-maintscript-helper
 		apache2_invoke #HELPER# #NAMES# || #ERROR_HANDLER#
 	fi
 fi

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



More information about the Pkg-apache-commits mailing list