X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=2b6d3a000aef72f48eb672670e37aaf2682085e6;hb=6e411345cb8c762cc69ce4ad202344ece984c9d4;hp=7c6aab755b9a7b76823915fe0859cd8e8e371952;hpb=01a53f5ca6a78f1513e508235884b635f3816122;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 7c6aab7..2b6d3a0 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -594,38 +594,31 @@ upgrade_libc () { 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 () { @@ -657,11 +650,36 @@ upgrade_amavis () { # fix openldap-aai postinst user handling upgrade_openldap () { - #pkgrm openldap-cn # deprecated - 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 + pkg openldap-aai lt 2.3 || return 0 + + # slapd postinst fails if move_old_database is false + echo 'slapd slapd/move_old_database boolean true' | debconf-set-selections + pkgadd slapd + + # openldap-aai postinst fails here because of database permissions + if ! apt-get -y install openldap-aai; then + chown -R openldap:openldap /var/lib/ldap # fix slapd + /etc/init.d/slapd restart + + # try openldap-aai postinst again (also re-enables slurpd) + dpkg --configure -a + fi +} + +# fix postgresql deinstallation during upgrade +upgrade_postgresql () { + if check_services show 2>&1 | grep -qw postgresql; then + pkgadd postgresql + fi +} + +# upgrade the MTA +upgrade_postfix () { + pkgadd postfix-cn + + if pkg postgrey; then + pkgrm postgrey # not used by postfix-cn anymore + fi } get_variable () { @@ -707,16 +725,6 @@ upgrade_dovecot () { 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