X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=904082263f89cf92cff4b061a67f35a4247bf661;hb=8ca348a924a2c02487dc34ca16376d29ded5029d;hp=8a76e8b1a2a62a5e706f6129d9d85df7c691175c;hpb=9742d3662fe74ee8d7f0d510c9198fedeba13f35;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 8a76e8b..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 @@ -895,49 +902,6 @@ restore_configs () { restore_file /etc/monit/monitrc $config_new rm -f $config_new fi - -# restore_config login 1:4.0.18.1 /etc/pam.d/login -# restore_config mysql-server 5.0.3 /etc/init.d/mysql \ -# /etc/logrotate.d/mysql-server \ -# /etc/mysql/my.cnf -# restore_config ntpdate 1:4.2.2 /etc/default/ntpdate -# restore_config oidentd 2.0.8 /etc/default/oidentd -# restore_config slapd 2.3.30 /etc/default/slapd /etc/init.d/slapd -# restore_config squirrelmail 2:1.4.9a /etc/squirrelmail/apache.conf -# restore_config vsftpd 2.0.5 /etc/vsftpd.conf -# restore_config xinetd 1:2.3.14 /etc/xinetd.conf -# -# # orphaned config file - no owner -# if pkg logcheck-database lt 1.2.54; then -# rm -vf /etc/logcheck/ignore.d.server/imap -# fi -# -# # aide switched to ucf, move old configs aside -# if pkg aide lt 0.13.1; then -# for file in /etc/aide/aide.conf \ -# /etc/cron.daily/aide \ -# /etc/default/aide; -# do -# if [ ! -e "$file.$backup_ext" ]; then -# mv -v "$file" "$file.$backup_ext" -# fi -# -# rm -vf "$file" -# done -# fi -# -# # register cn changes in ucf managed files -# for config in /etc/apache/modules.conf \ -# /etc/clamav/clamd.conf \ -# /etc/clamav/freshclam.conf -# 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 -# done } # temporary disable listchanges packages to reduce clutter during upgrade @@ -1062,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 } @@ -1219,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 @@ -1307,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 <