Package: bison
Version: 1:2.1-0.2
Severity: normal
Tags: patch

The postinstall script has no "upgrade" path; if you intend to do
things only on initial install (or after reinstalling after being
purged), you can test -z "$2".  But, since you should handle
postinst abort-deconfigure and abort-remove, I think it is best to
just add the alternative unconditionally.

Since new prerm failed-upgrade attempts the same thing as old prerm
upgrade, they should be treated the same way (until you notice a
hypothetical problem, in which case they *might* be different..).

--- /var/lib/dpkg/info/bison.postinst   2005-11-13 05:39:07.000000000 -0500
+++ /tmp/bison.postinst 2006-06-20 21:42:12.000000000 -0400
@@ -1,13 +1,21 @@
-#!/bin/sh
-
+#! /bin/sh
 set -e
 
-if [ $1 != "upgrade" ] ; then
-
-        update-alternatives --install /usr/bin/yacc yacc /usr/bin/bison.yacc 
100 \
-               --slave /usr/share/man/man1/yacc.1.gz yaccman 
/usr/share/man/man1/bison.1.gz
-
-fi
-
-
-
+case "$1" in
+configure|abort-remove|abort-deconfigure)
+        update-alternatives --install /usr/bin/yacc yacc \
+         /usr/bin/bison.yacc 100 \
+         --slave /usr/share/man/man1/yacc.1.gz yaccman \
+         /usr/share/man/man1/bison.1.gz
+       ;;
+
+abort-upgrade)
+       # Nothing to undo
+       :;
+       ;;
+
+*)
+       echo "$0: Undocumented call: \"[EMAIL PROTECTED]"" >&2
+       exit 1
+       ;;
+esac



--- /var/lib/dpkg/info/bison.prerm      2005-11-13 05:39:07.000000000 -0500
+++ /tmp/bison.prerm    2006-06-20 21:36:04.000000000 -0400
@@ -1,7 +1,17 @@
-#!/bin/sh
+#! /bin/sh
+set -e
 
-if [ $1 != "upgrade" ] ; then
-        update-alternatives --remove yacc /usr/bin/bison.yacc
-fi
+case "$1" in
+upgrade|failed-upgrade)
+       :;
+       ;;
 
+remove|deconfigure)
+       update-alternatives --remove yacc /usr/bin/bison.yacc
+       ;;
 
+*)
+       echo "Undocumented call: \"[EMAIL PROTECTED]"" >&2
+       exit 1
+       ;;
+esac


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to