X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=ddcb7e0413e42b918c6f1506167be4e364735323;hb=76df4be0475a22d848755eda27ce23845df70279;hp=7c6aab755b9a7b76823915fe0859cd8e8e371952;hpb=01a53f5ca6a78f1513e508235884b635f3816122;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 7c6aab7..ddcb7e0 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 () { @@ -664,6 +657,22 @@ upgrade_openldap () { 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 @@ -707,16 +716,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