+
+ # register cn changes in apache files
+ for config in /etc/php4/cgi/php.ini \
+ /etc/php4/cli/php.ini \
+ /etc/php4/apache/php.ini \
+ /etc/php4/apache2/php.ini \
+ /etc/apache/modules.conf
+ do
+ config_backup=$config.$backup_ext
+ if [ -e $config -a ! -e $config_backup ]; then
+ cp -av $config $config_backup
+ ucf $config_backup $config
+ fi
+ done
+}
+
+# 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