[Pkg-apache-commits] [SCM] Debian packaging for apache2 (Apache HTTPD 2.x) branch, next, updated. 1b061a0344c5f3cc459e769e2ad0e62be6f570cb
Stefan Fritsch
sf at sfritsch.de
Sat Mar 17 20:45:11 UTC 2012
The following commit has been merged in the next branch:
commit b57766dbd2b45ba09bda58cbfcc2af18c3c0b4cf
Author: Stefan Fritsch <sf at sfritsch.de>
Date: Fri Mar 16 20:44:37 2012 +0100
unexpand tabs, no code change
diff --git a/debian/apache2-suexec.prerm.in b/debian/apache2-suexec.prerm.in
index 9a92615..2c958e6 100755
--- a/debian/apache2-suexec.prerm.in
+++ b/debian/apache2-suexec.prerm.in
@@ -5,15 +5,15 @@ set -e
case "$1" in
remove|upgrade|deconfigure)
- update-alternatives --remove /usr/lib/apache2/suexec-__TYPE__ suexec
+ update-alternatives --remove /usr/lib/apache2/suexec-__TYPE__ suexec
;;
failed-upgrade)
;;
*)
- echo "prerm called with unknown argument \`$1'" >&2
- exit 1
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 1
;;
esac
diff --git a/debian/apache2.postinst b/debian/apache2.postinst
old mode 100755
new mode 100644
index ae95ffc..5521bdf
--- a/debian/apache2.postinst
+++ b/debian/apache2.postinst
@@ -51,19 +51,19 @@ SQUEEZE_UPGRADE=0
# around or an /etc/apache2/.apache2_upgrade file exists.
we_are_upgrading_from_squeeze()
{
- if [ -n "$2" ] && dpkg --compare-versions "$2" le-nl "2.3"; then
- return 0
- fi
+ if [ -n "$2" ] && dpkg --compare-versions "$2" le-nl "2.3"; then
+ return 0
+ fi
# this check is a probably tautology but makes it easier to understand
# the logic
if [ -n "$2" ] && dpkg --compare-versions "$2" ge-nl "2.3"; then
- return 1
- fi
+ return 1
+ fi
- if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
- return 0
- fi
+ if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
+ return 0
+ fi
if [ $SQUEEZE_UPGRADE -eq 1 ] ; then
return 0
@@ -84,14 +84,14 @@ we_are_upgrading_from_squeeze()
fi
done
- return 1
+ return 1
}
is_fresh_install()
{
- if [ -z "$2" ] ; then
- return 0
- fi
+ if [ -z "$2" ] ; then
+ return 0
+ fi
return 1
}
@@ -101,21 +101,21 @@ is_fresh_install()
remove_conffiles()
{
- # we can't use dpkg-maintscript-helper as we shifted conffiles from the
- # apache2.2-common package to apache2, too. The tool can cope with
- # that, but additionally we didn't require apache2 to be installed. This
- # yields the wrong result when upgrading such an installation
- if we_are_upgrading_from_squeeze $@ ; then
- for CONFFILE in $OBSOLETE_CONFFILES ; do
- if [ -e "$CONFFILE.dpkg-backup" ]; then
- mv -f "$CONFFILE.dpkg-backup" "$CONFFILE.dpkg-bak"
- fi
- if [ -e "$CONFFILE.dpkg-remove" ]; then
- echo "Removing obsolete conffile $CONFFILE ..."
- rm -f "$CONFFILE.dpkg-remove"
- fi
- done
- fi
+ # we can't use dpkg-maintscript-helper as we shifted conffiles from the
+ # apache2.2-common package to apache2, too. The tool can cope with
+ # that, but additionally we didn't require apache2 to be installed. This
+ # yields the wrong result when upgrading such an installation
+ if we_are_upgrading_from_squeeze $@ ; then
+ for CONFFILE in $OBSOLETE_CONFFILES ; do
+ if [ -e "$CONFFILE.dpkg-backup" ]; then
+ mv -f "$CONFFILE.dpkg-backup" "$CONFFILE.dpkg-bak"
+ fi
+ if [ -e "$CONFFILE.dpkg-remove" ]; then
+ echo "Removing obsolete conffile $CONFFILE ..."
+ rm -f "$CONFFILE.dpkg-remove"
+ fi
+ done
+ fi
}
mv_conffiles()
@@ -149,38 +149,38 @@ mv_conffiles()
enable_default_mpm()
{
- mpm="mpm_event"
- if we_are_upgrading_from_squeeze $@ && [ -e /etc/apache2/.apache2_mpm_selected ]; then
- tmpmpm=$(grep -v "^#" /etc/apache2/.apache2_mpm_selected | head -n1)
- case "$tmpmpm" in
- apache2-mpm-worker)
- mpm="mpm_worker"
- ;;
-
- apache2-mpm-event)
- mpm="mpm_event"
- ;;
-
- apache2-mpm-prefork)
- mpm="mpm_prefork"
- ;;
-
- apache2-mpm-itk)
- # Houston, we got a problem
+ mpm="mpm_event"
+ if we_are_upgrading_from_squeeze $@ && [ -e /etc/apache2/.apache2_mpm_selected ]; then
+ tmpmpm=$(grep -v "^#" /etc/apache2/.apache2_mpm_selected | head -n1)
+ case "$tmpmpm" in
+ apache2-mpm-worker)
+ mpm="mpm_worker"
+ ;;
+
+ apache2-mpm-event)
+ mpm="mpm_event"
+ ;;
+
+ apache2-mpm-prefork)
+ mpm="mpm_prefork"
+ ;;
+
+ apache2-mpm-itk)
+ # Houston, we got a problem
# XXX: Maybe display a big warning?
mpm="mpm_prefork"
- ;;
+ ;;
- *)
- # default MPM for upgrading in case we got an unrecognized
- # hint file
- mpm="mpm_event"
- ;;
- esac
+ *)
+ # default MPM for upgrading in case we got an unrecognized
+ # hint file
+ mpm="mpm_event"
+ ;;
+ esac
- a2enmod -q $mpm
+ a2enmod -q $mpm
return 0
- fi
+ fi
if is_fresh_install $@ ; then
a2enmod -q $mpm
@@ -196,9 +196,9 @@ enable_default_mpm()
enable_default_modules()
{
if is_fresh_install $@ || we_are_upgrading_from_squeeze $@; then
- for module in authz_host alias cgi dir autoindex mime negotiation ; do
- a2enmod -q $module
- done
+ for module in authz_host alias cgi dir autoindex mime negotiation ; do
+ a2enmod -q $module
+ done
fi
}
@@ -227,14 +227,14 @@ install_default_site()
fi
done
elif is_fresh_install $@ ; then
- if [ ! -L /etc/apache2/sites-enabled/000-default.conf -a \
- ! -f /etc/apache2/sites-enabled/000-default.conf ]; then
- a2ensite -q 000-default
- fi
+ if [ ! -L /etc/apache2/sites-enabled/000-default.conf -a \
+ ! -f /etc/apache2/sites-enabled/000-default.conf ]; then
+ a2ensite -q 000-default
+ fi
- touch /var/log/apache2/error.log /var/log/apache2/access.log
- chown root:adm /var/log/apache2/error.log /var/log/apache2/access.log
- chmod 0640 /var/log/apache2/error.log /var/log/apache2/access.log
+ touch /var/log/apache2/error.log /var/log/apache2/access.log
+ chown root:adm /var/log/apache2/error.log /var/log/apache2/access.log
+ chmod 0640 /var/log/apache2/error.log /var/log/apache2/access.log
touch /var/log/apache2/other_vhosts_access.log
chown root:adm /var/log/apache2/other_vhosts_access.log
@@ -262,40 +262,40 @@ install_default_files()
# XXX: Find out whether I am on crack removing stale modules that way
refresh_modules()
{
- if we_are_upgrading_from_squeeze $@ && [ -d /etc/apache2/mods-enabled/ ] ; then
- shopt -s nullglob
- for link in /etc/apache2/mods-enabled/*.load ; do
- target=$(readlink "$link") || true
- if [ -z "$target" ] ; then
- continue
- fi
+ if we_are_upgrading_from_squeeze $@ && [ -d /etc/apache2/mods-enabled/ ] ; then
+ shopt -s nullglob
+ for link in /etc/apache2/mods-enabled/*.load ; do
+ target=$(readlink "$link") || true
+ if [ -z "$target" ] ; then
+ continue
+ fi
- module=$(basename "$link" | sed 's/\.load//') || true
+ module=$(basename "$link" | sed 's/\.load//') || true
- if [ ! -e "/etc/apache2/mods-enabled/$target" ] ; then
- echo "disable obsolete module $module"
- a2dismod -q "$module"
+ if [ ! -e "/etc/apache2/mods-enabled/$target" ] ; then
+ echo "disable obsolete module $module"
+ a2dismod -q "$module"
if [ "$module" = "disk_cache" ] ; then
echo "Enable cache_disk as disk_cache was enabled in Apache 2.2"
a2enmod -q cache_disk
fi
- fi
- # the module is already enabled, however
- # dependencies could have changed hence re-call
- # a2enmod again.
- # Example: the deflate module when upgraded from
- # Squeeze
- if [ -e "/etc/apache2/mods-enabled/$target" ] ; then
- a2enmod -q "$module"
- fi
- done
- fi
+ fi
+ # the module is already enabled, however
+ # dependencies could have changed hence re-call
+ # a2enmod again.
+ # Example: the deflate module when upgraded from
+ # Squeeze
+ if [ -e "/etc/apache2/mods-enabled/$target" ] ; then
+ a2enmod -q "$module"
+ fi
+ done
+ fi
}
move_httpd_conf()
{
- if we_are_upgrading_from_squeeze $@ ; then
+ 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" ] ||
@@ -341,7 +341,7 @@ guess_access_compat()
if [ -f /etc/apache2/apache2.conf ] ; then
CONFS="/etc/apache2/apache2.conf"
fi
- shopt -s nullglob
+ shopt -s nullglob
for confdir in /etc/apache2/sites-enabled /etc/apache2/conf-enabled /etc/apache2/mods-enabled ; do
if [ -d $confdir ] ; then
for conffile in $confdir/*.load ; do
@@ -364,35 +364,35 @@ guess_access_compat()
# all files which look like site configuration?
case "$1" in
- configure)
+ configure)
- remove_conffiles $@
+ remove_conffiles $@
mv_conffiles $@
- enable_default_mpm $@
- refresh_modules $@
- install_default_files $@
- enable_default_modules $@
+ enable_default_mpm $@
+ refresh_modules $@
+ install_default_files $@
+ enable_default_modules $@
enable_default_conf $@
- install_default_site $@
+ install_default_site $@
move_httpd_conf $@
migrate_data $@
guess_access_compat $@
- # post installation cleanup
- if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
- rm -f /etc/apache2/.apache2_mpm_selected
- fi
+ # post installation cleanup
+ if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
+ rm -f /etc/apache2/.apache2_mpm_selected
+ fi
- ;;
+ ;;
- abort-upgrade|abort-remove|abort-deconfigure)
+ abort-upgrade|abort-remove|abort-deconfigure)
- ;;
+ ;;
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 1
- ;;
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
esac
#DEBHELPER#
diff --git a/debian/apache2.postrm b/debian/apache2.postrm
index c7a85ac..95a2123 100644
--- a/debian/apache2.postrm
+++ b/debian/apache2.postrm
@@ -48,9 +48,9 @@ case "$1" in
fi
fi
- for CONFFILE in $OBSOLETE_CONFFILES ; do
- rm -f "$CONFFILE.dpkg-bak" "$CONFFILE.dpkg-remove" "$CONFFILE.dpkg-backup"
- done
+ for CONFFILE in $OBSOLETE_CONFFILES ; do
+ rm -f "$CONFFILE.dpkg-bak" "$CONFFILE.dpkg-remove" "$CONFFILE.dpkg-backup"
+ done
for d in var/cache/apache2 \
var/cache/apache2/mod_cache_disk \
@@ -79,17 +79,17 @@ case "$1" in
abort-install|abort-upgrade)
- for CONFFILE in $OBSOLETE_CONFFILES ; do
+ for CONFFILE in $OBSOLETE_CONFFILES ; do
- if [ -e "$CONFFILE.dpkg-remove" ]; then
- echo "Reinstalling $CONFFILE that was moved away"
- mv "$CONFFILE.dpkg-remove" "$CONFFILE"
- fi
- if [ -e "$CONFFILE.dpkg-backup" ]; then
- echo "Reinstalling $CONFFILE that was backupped"
- mv "$CONFFILE.dpkg-backup" "$CONFFILE"
- fi
- done
+ if [ -e "$CONFFILE.dpkg-remove" ]; then
+ echo "Reinstalling $CONFFILE that was moved away"
+ mv "$CONFFILE.dpkg-remove" "$CONFFILE"
+ fi
+ if [ -e "$CONFFILE.dpkg-backup" ]; then
+ echo "Reinstalling $CONFFILE that was backupped"
+ mv "$CONFFILE.dpkg-backup" "$CONFFILE"
+ fi
+ done
for CONFFILE in $MOVED_CONFFILES ; do
@@ -105,10 +105,10 @@ case "$1" in
fi
done
- # post installation cleanup
- if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
- rm -f /etc/apache2/.apache2_mpm_selected
- fi
+ # post installation cleanup
+ if [ -e /etc/apache2/.apache2_mpm_selected ] ; then
+ rm -f /etc/apache2/.apache2_mpm_selected
+ fi
;;
@@ -116,8 +116,8 @@ case "$1" in
;;
*)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 1
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
;;
esac
diff --git a/debian/apache2.preinst b/debian/apache2.preinst
index ce4f09c..f02d3f2 100644
--- a/debian/apache2.preinst
+++ b/debian/apache2.preinst
@@ -60,21 +60,21 @@ obsolete_conffile_exists()
# See the dpkg-maintscript-helper script for details
prepare_rm_conffile()
{
- for CONFFILE in $OBSOLETE_CONFFILES ; do
- [ -e "$CONFFILE" ] || continue
-
- local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
- local old_md5sum="$(dpkg-query -W -f='${Conffiles}' apache2.2-common apache2 | \
- sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
- if [ "$md5sum" != "$old_md5sum" ]; then
- echo "Obsolete conffile $CONFFILE has been modified by you."
- echo "Saving as $CONFFILE.dpkg-bak ..."
- mv -f "$CONFFILE" "$CONFFILE.dpkg-backup"
- else
- echo "Moving obsolete conffile $CONFFILE out of the way..."
- mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
- fi
- done
+ for CONFFILE in $OBSOLETE_CONFFILES ; do
+ [ -e "$CONFFILE" ] || continue
+
+ local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+ local old_md5sum="$(dpkg-query -W -f='${Conffiles}' apache2.2-common apache2 | \
+ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+ if [ "$md5sum" != "$old_md5sum" ]; then
+ echo "Obsolete conffile $CONFFILE has been modified by you."
+ echo "Saving as $CONFFILE.dpkg-bak ..."
+ mv -f "$CONFFILE" "$CONFFILE.dpkg-backup"
+ else
+ echo "Moving obsolete conffile $CONFFILE out of the way..."
+ mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
+ fi
+ done
}
prepare_mv_conffile()
@@ -98,27 +98,27 @@ prepare_mv_conffile()
case "$1" in
install|upgrade)
- # black magic follows below. we're upgrading from Squeeze if
-
- # 1) an apache2-mpm package exists
- if [ -d "/etc/apache2/" ] ; then
- mpm=$(dpkg-query -f '${Package}\t${Status}\n' -W 'apache2-mpm-*' 2>/dev/null) || true
- if [ $? -eq 0 ] ; then
- mpm=$(echo "$mpm" | grep "install ok" | cut -f1)
- if [ ! -f /etc/apache2/.apache2_mpm_selected ] ; then
- echo "# automatically created during upgrade" >> /etc/apache2/.apache2_mpm_selected
- echo "# it can be safely removed anytime" >> /etc/apache2/.apache2_mpm_selected
- echo "$mpm" >> /etc/apache2/.apache2_mpm_selected
- fi
- fi
- fi
-
- # 2) an apache2.2-common conffiles exists or the 2.2 apache2 package is
+ # black magic follows below. we're upgrading from Squeeze if
+
+ # 1) an apache2-mpm package exists
+ if [ -d "/etc/apache2/" ] ; then
+ mpm=$(dpkg-query -f '${Package}\t${Status}\n' -W 'apache2-mpm-*' 2>/dev/null) || true
+ if [ $? -eq 0 ] ; then
+ mpm=$(echo "$mpm" | grep "install ok" | cut -f1)
+ if [ ! -f /etc/apache2/.apache2_mpm_selected ] ; then
+ echo "# automatically created during upgrade" >> /etc/apache2/.apache2_mpm_selected
+ echo "# it can be safely removed anytime" >> /etc/apache2/.apache2_mpm_selected
+ echo "$mpm" >> /etc/apache2/.apache2_mpm_selected
+ fi
+ fi
+ fi
+
+ # 2) an apache2.2-common conffiles exists or the 2.2 apache2 package is
# installed
if [ -n "$2" ] || obsolete_conffile_exists ; then
prepare_rm_conffile
prepare_mv_conffile
- fi
+ fi
;;
@@ -126,8 +126,8 @@ case "$1" in
;;
*)
- echo "preinst called with unknown argument \`$1'" >&2
- exit 1
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
;;
esac
--
Debian packaging for apache2 (Apache HTTPD 2.x)
More information about the Pkg-apache-commits
mailing list