Add externs to avoid multiple definitions, and then add missing definitions.
[rrq/maintain_lilo.git] / debian / lilo.postrm
index 255bcbe2b66d971f84acd1b3fcdbbd39234a9717..f597e10d0a351c92f120029070bd948a461f9603 100644 (file)
@@ -1,18 +1,49 @@
-#!/bin/sh -e
+#!/bin/sh
+# postrm script lilo
+#
+# see: dh_installdeb(1)
 
-#DEBHELPER#
+set -e
+
+CONF="/etc/lilo.conf"
+MMAP="/boot/map"
+BMPS="coffee debian debian-de inside onlyblue tuxlogo debianlilo"
+
+# remove old-named config files
+dpkg-maintscript-helper rm_conffile \
+  /etc/kernel/postinst.d/zz-lilo  1:22.8-10 lilo -- "$@"
+
+dpkg-maintscript-helper rm_conffile \
+  /etc/kernel/postrm.d/zz-lilo    1:22.8-10 lilo -- "$@"
+
+dpkg-maintscript-helper rm_conffile \
+  /etc/kernel/postinst.d/zz-lilo  1:22.8-10 lilo -- "$@"
 
-for i in sid.bmp sarge.bmp debianlilo.bmp coffee.bmp; do
-       rm -f /boot/$i;
-done
+dpkg-maintscript-helper rm_conffile \
+  /etc/initramfs/post-update.d/lilo  1:22.8-10 lilo -- "$@"
 
-if [ "$1" = "purge" ]; then
-    rm -f /etc/lilo.conf /boot/map /boot/boot.b /boot/boot.0[0-9][0-9][0-9]
-   
-    if [ -d /usr/share/lilo ]; then
-       rm -rf /usr/share/lilo
-    fi 
 
-    rm -f /usr/share/lilo/*.conf
+# targets: purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear
+
+case "$1" in
+       purge)
+               test -f ${CONF} && mv ${CONF} ${CONF}_backup
+               test -f ${MMAP} && rm -f ${MMAP}
+       ;;
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+               for i in ${BMPS}; do
+                       rm -f /boot/${i}.bmp /boot/${i}.dat;
+               done
+    ;;
+       *)
+               echo "postrm called with unknown argument \`$1'" >&2
+               exit 1
+       ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
 
-fi
+exit 0