X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=ddcb7e0413e42b918c6f1506167be4e364735323;hb=76df4be0475a22d848755eda27ce23845df70279;hp=22ba7a6346d640a86e3b9dda127d12de9fb9f98d;hpb=45c30989728af6d256fe40cbb16ebdbd672b5bc5;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 22ba7a6..ddcb7e0 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -229,8 +229,8 @@ run_actions() { check=$(echo "$line" | sed 's/ */ /g'| awk -F' ' '{print $1}') action=$(echo "$line" | sed 's/ */ /g'| awk -F' ' '{print $2}') checkmsg="" - [ "$test" != "true" ] && checkmsg="if '$test'" - if eval $test; then + [ "$check" != "true" ] && checkmsg="if '$check'" + if eval $check; then log "$(printf 'action %02d' $lineno) starting: '${action}' $checkmsg " eval $action log "$(printf 'action %02d' $lineno) finished: '${action}' $checkmsg" @@ -286,7 +286,7 @@ check_apache_version () { if pkg apache-cn && ! pkg apache2-cn; then notice " -Prije prelaska na Debian Etch potrebno je napraviti nadogradnju sa apache 1.3 na apache 2.0. +Prije prelaska na Debian Etch potrebno je napraviti nadogradnju sa Apache 1.3 na Apache 2.0. Pokrenite: 'apt-get install apache2-cn' @@ -539,6 +539,7 @@ restore_configs () { do config_backup=$config.$backup_ext if [ -e $config -a ! -e $config_backup ]; then + log "Saving config file $config" cp -av $config $config_backup ucf $config_backup $config fi @@ -593,38 +594,31 @@ upgrade_libc () { DEBIAN_FRONTEND=noninteractive pkgadd libc6 } -# upgrade apache -> apache2 -upgrade_apache () { - local delpkg p +# upgrade apache2 to etch +upgrade_apache2 () { + local package packages - # bugfix for apache2-cn postinst - mkdir -p /etc/apache2 - touch /etc/apache2/httpd.conf + # php-suhosin-cn causes removal of applications on dist-upgrade + # because of php5 only dependencies + pkgrm php-suhosin-cn - # 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 + 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 () { @@ -663,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