Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / var / lib / dpkg / info / | server ip : 172.67.156.115 your ip : 172.69.58.68 H O M E |
Filename | /var/lib/dpkg/info/apache2.preinst |
Size | 4.49 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 10:07 |
Last modified | 04-Apr-2019 02:05 |
Last accessed | 06-Jul-2025 22:07 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#! /bin/bash
# preinst script for apache2
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
# XXX remove
# echo apache2.preinst $@ running
# XXX: Whichever file you add in one of the sections below, make sure you copy
# the same file arrays to apache2.postinst and apache2.postrm, too!
OBSOLETE_CONFFILES="/etc/apache2/mods-available/authz_default.load
/etc/apache2/mods-available/authn_default.load
/etc/apache2/mods-available/mem_cache.load
/etc/apache2/mods-available/mem_cache.conf
/etc/apache2/mods-available/authn_alias.load
/etc/apache2/mods-available/cern_meta.load
/etc/apache2/mods-available/disk_cache.load
/etc/apache2/mods-available/disk_cache.conf
/etc/apache2/mods-available/ident.load
/etc/apache2/mods-available/imagemap.load
/etc/apache2/mods-available/version.load"
# conffiles which moved from one random location to another, separate source and
# destination by a colon
MOVED_CONFFILES="/etc/bash_completion.d/apache2.2-common:/etc/bash_completion.d/apache2
/etc/apache2/sites-available/default:/etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/default-ssl:/etc/apache2/sites-available/default-ssl.conf
/etc/apache2/conf.d/charset:/etc/apache2/conf-available/charset.conf
/etc/apache2/conf.d/localized-error-pages:/etc/apache2/conf-available/localized-error-pages.conf
/etc/apache2/conf.d/other-vhosts-access-log:/etc/apache2/conf-available/other-vhosts-access-log.conf
/etc/apache2/conf.d/security:/etc/apache2/conf-available/security.conf"
obsolete_conffile_exists()
{
for CONFFILE in $OBSOLETE_CONFFILES ; do
if [ -e "$CONFFILE" ] ; then
return 0
fi
done
for CONFFILE in $MOVED_CONFFILES_IN ; do
if [ -e "/etc/apache2/conf.d/$CONFFILE" ] ; then
return 0
fi
done
return 1
}
# The two functions below are licensed GPL-2+ and was written by dpkg maintainers
# 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
}
prepare_mv_conffile()
{
for CONFFILE in $MOVED_CONFFILES ; do
CONFFILE=$( echo "$CONFFILE" | cut -d: -f1 )
[ -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
mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
fi
done
}
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 | grep "install ok" | cut -f1)
if [ -n "$mpm" ] ; then
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
if [ -n "$2" ] && dpkg --compare-versions "$2" 'lt' '2.4.7-1~' && dpkg --compare-versions "$2" 'ge' '2.4.1-1' ; then
CUR_MPM=$(a2query -M) || exit 1
if [ "$CUR_MPM" == "itk" ] ; then
echo "apache2-mpm-itk" >> /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
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
# vim: syntax=sh ts=4 sw=4 sts=4 sr noet
# preinst script for apache2
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
# XXX remove
# echo apache2.preinst $@ running
# XXX: Whichever file you add in one of the sections below, make sure you copy
# the same file arrays to apache2.postinst and apache2.postrm, too!
OBSOLETE_CONFFILES="/etc/apache2/mods-available/authz_default.load
/etc/apache2/mods-available/authn_default.load
/etc/apache2/mods-available/mem_cache.load
/etc/apache2/mods-available/mem_cache.conf
/etc/apache2/mods-available/authn_alias.load
/etc/apache2/mods-available/cern_meta.load
/etc/apache2/mods-available/disk_cache.load
/etc/apache2/mods-available/disk_cache.conf
/etc/apache2/mods-available/ident.load
/etc/apache2/mods-available/imagemap.load
/etc/apache2/mods-available/version.load"
# conffiles which moved from one random location to another, separate source and
# destination by a colon
MOVED_CONFFILES="/etc/bash_completion.d/apache2.2-common:/etc/bash_completion.d/apache2
/etc/apache2/sites-available/default:/etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/default-ssl:/etc/apache2/sites-available/default-ssl.conf
/etc/apache2/conf.d/charset:/etc/apache2/conf-available/charset.conf
/etc/apache2/conf.d/localized-error-pages:/etc/apache2/conf-available/localized-error-pages.conf
/etc/apache2/conf.d/other-vhosts-access-log:/etc/apache2/conf-available/other-vhosts-access-log.conf
/etc/apache2/conf.d/security:/etc/apache2/conf-available/security.conf"
obsolete_conffile_exists()
{
for CONFFILE in $OBSOLETE_CONFFILES ; do
if [ -e "$CONFFILE" ] ; then
return 0
fi
done
for CONFFILE in $MOVED_CONFFILES_IN ; do
if [ -e "/etc/apache2/conf.d/$CONFFILE" ] ; then
return 0
fi
done
return 1
}
# The two functions below are licensed GPL-2+ and was written by dpkg maintainers
# 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
}
prepare_mv_conffile()
{
for CONFFILE in $MOVED_CONFFILES ; do
CONFFILE=$( echo "$CONFFILE" | cut -d: -f1 )
[ -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
mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
fi
done
}
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 | grep "install ok" | cut -f1)
if [ -n "$mpm" ] ; then
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
if [ -n "$2" ] && dpkg --compare-versions "$2" 'lt' '2.4.7-1~' && dpkg --compare-versions "$2" 'ge' '2.4.1-1' ; then
CUR_MPM=$(a2query -M) || exit 1
if [ "$CUR_MPM" == "itk" ] ; then
echo "apache2-mpm-itk" >> /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
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
# vim: syntax=sh ts=4 sw=4 sts=4 sr noet