X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=904082263f89cf92cff4b061a67f35a4247bf661;hb=8ca348a924a2c02487dc34ca16376d29ded5029d;hp=6f162903670f01bc9b8faa09874165cf36e8b0e2;hpb=1bfc033259cebfaa0ca3dec10fbbf1ca450d44f1;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 6f16290..9040822 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -157,7 +157,7 @@ remove_x() { LC_MESSAGES=hr_HR dialog --backtitle "$title" --yesno "$msg_remove_x" 18 75 if [ $? -eq 0 ]; then log "Removing X Window System" - pkgrm xlibs + pkgrm x11-common else log "Skipping X Window System removal" fi @@ -603,6 +603,13 @@ upgrade () { pkgadd_if_installed $packages } +# install packages introduced in this release +install_new () { + if [ "$new_packages" ]; then + pkgadd $new_packages + fi +} + # funkcija utrpa ispravan sources.list create_sources_list () { local sl sl_new @@ -1019,6 +1026,7 @@ upgrade_libc () { # upgrade apache2/php5 to lenny upgrade_apache2 () { + pkgrm apache-common # prevents installation of apache2-suexec pkgadd_if_installed libapache2-mod-php5 php5-cli php5-cn apache2-cn \ php5-odbc php5-suhosin php-suhosin-cn } @@ -1176,38 +1184,6 @@ get_variable () { echo $val } -# preserve mail location on upgrade -upgrade_dovecot () { - local default_mail_env mail_location - - # check if already upgraded - if ! pkg dovecot-common lt 1.0; then - return - fi - - # save old mail location - default_mail_env=$(get_variable default_mail_env /etc/dovecot/dovecot.conf) - - # silently upgrade package - restore_file /etc/dovecot/dovecot.conf - pkgadd dovecot-cn - - # insert old mail location - mail_location=$(get_variable mail_location /etc/dovecot/dovecot.conf) - if [ "$default_mail_env" -a ! "$mail_location" ]; then - check_and_sed '^#mail_location[[:space:]]*=' \ - "s|#mail_location[[:space:]]*=.*|mail_location = $default_mail_env|" /etc/dovecot/dovecot.conf || return 0 - - if [ -x /etc/init.d/dovecot ]; then - if [ -x /usr/sbin/invoke-rc.d ]; then - /usr/sbin/invoke-rc.d dovecot restart - else - /etc/init.d/dovecot restart - fi - fi - fi -} - # restore munin configs for silent upgrade upgrade_munin () { local config backup hostname domain @@ -1264,15 +1240,22 @@ comment_force_overwrite () { fi } +# try not to overwrite user modified issue files fix_issue () { - cat > /etc/issue </dev/null; then + cp -av /etc/issue /etc/issue.$backup_ext + cat > /etc/issue < /etc/issue.net </dev/null; then + cp -av /etc/issue.net /etc/issue.net.$backup_ext + cat > /etc/issue.net <