From 5626b6c6fa1a7cd1c48e5aaff41a663ee98cb397 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Tue, 5 Feb 2008 14:31:57 +0100 Subject: [PATCH] Use dpkg-divert to disable apt-listchanges. --- src/actions/main.queue | 3 ++- src/functions.sh | 28 +++++++++++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/actions/main.queue b/src/actions/main.queue index 16a6b5f..39044b2 100644 --- a/src/actions/main.queue +++ b/src/actions/main.queue @@ -4,7 +4,7 @@ true first_warning true check_upgrade true remove_bloat -true disable_apt_listchanges +true apt_listchanges disable true comment_force_overwrite # ruzna opcija za dpkg # ovo bi trebao biti zadnji post_upgrade - spremi popis # instaliranih servisa za koje cemo na kraju provjeriti da li rade. @@ -36,6 +36,7 @@ true dist_upgrade # instaliraj ostatak true debconf_priority reset true add_group_proc # za oidentd pkg kernel-2.6-cn dpkg-reconfigure kernel-2.6-cn +true apt_listchanges enable # ovo bi trebalo biti predzadnje na popisu # - izvrsi sve uvjetne post_upgrade akcije true run_post_upgrade diff --git a/src/functions.sh b/src/functions.sh index d3bd0de..25ef535 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -479,13 +479,27 @@ restore_configs () { fi } -# temporary remove listchanges packages to reduce clutter during upgrade -disable_apt_listchanges () { - for p in apt-listchanges apt-listchanges-cn; do - if pkg $p; then - pkgrm $p - post_upgrade pkgadd $p - fi +# temporary disable listchanges packages to reduce clutter during upgrade +apt_listchanges () { + local file command=$1 + + for file in /etc/apt/apt.conf.d/20listchanges \ + /etc/apt/apt.conf.d/20listchanges-cn + do + case $command in + disable) + if [ -f $file ]; then + dpkg-divert --local --rename --divert $file.$backup_ext \ + --add $file || true + fi + ;; + + enable) + if [ -f $file.$backup_ext ]; then + dpkg-divert --remove $file || true + fi + ;; + esac done } -- 1.7.10.4