DEBIAN_FRONTEND=noninteractive pkgadd libc6
}
-# upgrade apache -> apache2
-upgrade_apache () {
- local delpkg p
-
- # bugfix for apache2-cn postinst
- mkdir -p /etc/apache2
- touch /etc/apache2/httpd.conf
-
- # temporary remove packages conflicting with apache2
- delpkg=""
- for p in aosi-aai aosi-www-aai \
- php4-cn php4-odbc php4-xslt \
- squirrelmail-cn; do
-
- # remember installed packages
- if pkg $p; then
- delpkg="$delpkg $p"
- fi
+# upgrade apache2 to etch
+upgrade_apache2 () {
+ local package packages
+
+ # php-suhosin-cn causes removal of applications on dist-upgrade
+ # because of php5 only dependencies
+ pkgrm php-suhosin-cn
+
+ for package in \
+ libapache2-mod-php4 \
+ php4-cli \
+ php4-cgi \
+ php4-cn \
+ apache2-cn \
+ php4-odbc \
+ php4-suhosin
+ do
+ if pkg $package; then
+ packages="$packages $package"
+ fi
done
- # remove (but not purge) problematic packages
- if [ "$delpkg" ]; then
- eval apt-get --yes remove $delpkg
- fi
-
- # remove old apache
- pkgrm apache apache-common
-
- # install new packages
- eval pkgadd apache2-cn apache2-mpm-prefork \
- php4-cn libapache2-mod-php4 \
- $delpkg
+ for package in $packages; do
+ pkgadd $package
+ done
}
upgrade_amavis () {
# fix openldap-aai postinst user handling
upgrade_openldap () {
- #pkgrm openldap-cn # deprecated
+ # slapd postinst fails if this is false
+ echo 'slapd slapd/move_old_database boolean true' | debconf-set-selections
+
+ # workaround for race condition in openldap-aai postinst
apt-get -y$s install openldap-aai || true # postinst fails
chown -R openldap:openldap /var/lib/ldap # fix slapd
/etc/init.d/slapd restart
dpkg --configure -a # try postinst again
}
+# fix postgresql deinstallation during upgrade
+upgrade_postgresql () {
+ if check_services show 2>&1 | grep -qw postgresql; then
+ pkgadd postgresql || apt-get -f install
+ fi
+}
+
+# upgrade the MTA
+upgrade_postfix () {
+ pkgadd postfix-cn
+
+ if pkg postgrey; then
+ pkgrm postgrey # not used by postfix-cn anymore
+ fi
+}
+
get_variable () {
local name=$1 file=$2 val
fi
}
-# vsftpd.postinst tries to start vsftpd so make sure it is not running
-upgrade_vsftpd () {
- if [ -x /etc/init.d/vsftpd ]; then
- /etc/init.d/vsftpd stop || true
- fi
-
- pkg vsftpd && pkgadd vsftpd
- pkg vsftpd-cn && pkgadd vsftpd-cn
-}
-
# fix /etc/dpkg/dpkg.cfg
comment_force_overwrite () {
if [ -f /etc/dpkg/dpkg.cfg ]; then