+# restore munin configs for silent upgrade
+upgrade_munin () {
+ local config backup hostname domain
+
+ for pkg_name in munin munin-node; do
+ pkg $pkg_name lt '1.2.6-10~lenny1' || continue
+
+ config=/etc/munin/$pkg_name.conf
+ backup=$config.$backup_ext
+ if [ -f $config -a ! -f $backup ]; then
+ hostname=$(hostname)
+ domain=$(hostname --domain)
+
+ cp -av $config $backup
+ check_and_sed "$hostname.$domain" \
+ "s/$hostname.$domain/localhost.localdomain/g" $config
+ fi
+ pkgadd $pkg_name
+ done
+
+ # force localhost -> hostname replacement in config files
+ pkgadd munin-cn
+ dpkg-reconfigure munin-cn
+}
+
+# udev.preinst fails if devfs configs still exist
+upgrade_udev () {
+ local config
+
+ for config in /etc/udev/rules.d/devfs.rules \
+ /etc/udev/rules.d/compat-full.rules \
+ /etc/udev/rules.d/compat.rules
+ do
+ if [ -e $config ]; then
+ mv -v $config /etc/udev/
+ fi
+ done
+
+ if [ -f /etc/udev/udev.rules -a ! -f /etc/udev/rules.d/udev.rules ]; then
+ ln -sfv ../udev.rules /etc/udev/rules.d/
+ fi
+
+ pkgadd udev
+}
+