On Fri, Jun 03, 2005 at 01:21:24PM +0200, Agustin Martin wrote:

> Regarding the alternative removal from preinst, I would keep it for some
> time, until the -1 -> -2+ mess is mostly addressed by users (say, at most
> 1-2 months), and then remove it. It is a bug that might cause manual mode be
> lost, but will make upgrades from -1 easier. Another possibility would be to
> check in preinst if old version to be upgraded is "2.0.0-1" and remove
> alternative only if so. This would be cleaner, but considering that none
> of -1 or -2 are going into sarge, that we are in unstable, and that we are
> at the beginning of the post-sarge stage, this is probably an overkill.
> 

I have been playing with this last possibility, I expect something like the
attached patch should do the work. I somewhat edited it before submission,
so please check in your system that nothing is missed.

Cheers,

-- 
Agustin
--- fpc-2.0.0.orig/debian/fp-compiler.preinst
+++ fpc-2.0.0/debian/fp-compiler.preinst
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+set -e
+
+# Remove fpc from pc alternative if buggy 2.0.0-1 version is upgraded
+
+if [ "$1" = "upgrade" ] && [ "$2" = "2.0.0-1" ]; then
+    /usr/sbin/update-alternatives --remove pc /usr/bin/fpc
+fi
+
+# Debhelper code
+#DEBHELPER#
--- fpc-2.0.0.orig/debian/fp-compiler.prerm
+++ fpc-2.0.0/debian/fp-compiler.prerm
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+set -e
+
+# Remove fpc from pc alternative
+
+if [ "$1" != "upgrade" ]; then
+    /usr/sbin/update-alternatives --remove pc /usr/bin/fpc
+fi
+
+# Debhelper code
+#DEBHELPER#

Reply via email to