On 18/11/09 at 16:01 +0100, Manuel Prinz wrote:
> Am Mittwoch, den 18.11.2009, 07:35 -0600 schrieb Lucas Nussbaum:
> > Yeah, but the unconditional --removal-all looks a bit scary :-)
> 
> I know. There was discussion about that on the dpkg mailing list, IIRC.
> Other packages had similar problems. The recommended solution was to
> remove all and let u-a recreate the entries in postinst. My memory may
> be bad here, though. Anyway, you're fix is a lot nicer. ;)
> 
> > Do you want me to upload an NMU ? I have time this week.
> 
> If you'd like to, feel free to do an 0-day NMU. If Sylvestre doesn't
> have any objections, of course.
> 
> It would be cool if you could mail the debdiff, so that I can include it
> in our repository. TIA!

Hi,

I just uploaded openmpi 1.3.3-3.1 with my fixes. Attached is the
debdiff.
-- 
| Lucas Nussbaum
| lu...@lucas-nussbaum.net   http://www.lucas-nussbaum.net/ |
| jabber: lu...@nussbaum.fr             GPG: 1024D/023B3F4F |
reverted:
--- openmpi-1.3.3/debian/openmpi-bin.preinst
+++ openmpi-1.3.3.orig/debian/openmpi-bin.preinst
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-set -e
-
-# mpirun and mpiexec seemed to be used as a master alternative by some MPI
-# package. But currently, all MPI packages have the mpicc alternative installed
-# as a slave link. We remove the link here in order to resolve bug #532008,
-# #534740, and #544372.
-
-update-alternatives --quiet --remove-all mpirun  >/dev/null 2>&1 || true
-update-alternatives --quiet --remove-all mpiexec >/dev/null 2>&1 || true
-
-#DEBHELPER#
-
-exit 0
diff -u openmpi-1.3.3/debian/openmpi-bin.prerm openmpi-1.3.3/debian/openmpi-bin.prerm
--- openmpi-1.3.3/debian/openmpi-bin.prerm
+++ openmpi-1.3.3/debian/openmpi-bin.prerm
@@ -4,7 +4,6 @@
 
 if [ "$1" != "upgrade" ]; then
 	update-alternatives --remove mpirun /usr/bin/mpirun.openmpi
-	update-alternatives --remove mpiexec /usr/bin/mpiexec.openmpi
 fi
 
 #DEBHELPER#
diff -u openmpi-1.3.3/debian/changelog openmpi-1.3.3/debian/changelog
--- openmpi-1.3.3/debian/changelog
+++ openmpi-1.3.3/debian/changelog
@@ -1,3 +1,10 @@
+openmpi (1.3.3-3.1) unstable; urgency=low
+
+  * Non-maintainer upload with the maintainer's permission.
+  * Improve alternatives upgrade.
+
+ -- Lucas Nussbaum <lu...@lucas-nussbaum.net>  Thu, 19 Nov 2009 16:44:20 -0600
+
 openmpi (1.3.3-3) unstable; urgency=low
 
   * Removed mpiexec alternative, as discussed in #552429. It is now a slave
diff -u openmpi-1.3.3/debian/openmpi-bin.postinst openmpi-1.3.3/debian/openmpi-bin.postinst
--- openmpi-1.3.3/debian/openmpi-bin.postinst
+++ openmpi-1.3.3/debian/openmpi-bin.postinst
@@ -2,7 +2,26 @@
 
 set -e
 
-update-alternatives --quiet --remove-all mpiexec >/dev/null 2>&1 || true
+case "$1" in
+   configure)
+      # Continue below
+      ;;
+   abort-upgrade|abort-remove|abort-deconfigure)
+      exit 0;
+      ;;
+   *)
+      echo "postinst called with unknown argument \`$1'" >&2
+      exit 0;
+      ;;
+esac
+
+# so, we are running with $1 = configure
+# openmpi versions before 1.3.3-2 were using two alternatives where other
+# MPI implementations were using only one, which breaks. Clean up
+# our mess.
+if [ "$2" != "" ] && dpkg --compare-versions "$2" le "1.3.3-2"; then
+    update-alternatives --remove mpiexec /usr/bin/mpiexec.openmpi
+fi
 
 update-alternatives \
 	--install /usr/bin/mpirun mpirun /usr/bin/mpirun.openmpi 40 \

Reply via email to