]> err.no Git - util-linux/commitdiff
mount: fail in preinst if newer nfs-common is needed
authorLaMont Jones <lamont@mmjgroup.com>
Mon, 30 Jul 2007 14:09:52 +0000 (08:09 -0600)
committerLaMont Jones <lamont@mmjgroup.com>
Mon, 30 Jul 2007 14:24:34 +0000 (08:24 -0600)
debian/changelog
debian/mount.preinst [new file with mode: 0644]
debian/rules

index 94a7f9518cb3d760a61b36cd1dc047cdce58a4cd..a96978c1ab138c0c8abc68978fcc69cce89d5f5c 100644 (file)
@@ -1,11 +1,12 @@
-util-linux (2.13~rc2-4) unstable-UNRELEASED; urgency=low
+util-linux (2.13~rc2-4) unstable; urgency=low
 
   * switch to using libvolume-id-dev
   * Recommend: nfs-common so that portmap doesn't become defacto-Required.
     NFS mounts will not work unless nfs-common is upgraded to at least the
-    Recommended version.  See #435125.  Closes: #435204, #435223
+    Recommended version, so now mount.preinst will fail if there are NFS
+    mounts and no /usr/sbin/mount.nfs.  Closes: #435204, #435223, #435125
 
- -- LaMont Jones <lamont@debian.org>  Mon, 30 Jul 2007 01:01:08 -0600
+ -- LaMont Jones <lamont@debian.org>  Mon, 30 Jul 2007 08:07:37 -0600
 
 util-linux (2.13~rc2-3) unstable; urgency=low
 
diff --git a/debian/mount.preinst b/debian/mount.preinst
new file mode 100644 (file)
index 0000000..430f2e4
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh -e
+
+# Debian mount preinst
+# LaMont Jones <lamont@debian.org>
+
+### do we have debconf?
+##if [ -f /usr/share/debconf/confmodule ]; then
+##    . /usr/share/debconf/confmodule
+##    DEBCONF=true
+##else
+##    DEBCONF=
+##fi
+
+case "$1" in
+    install)
+       ;;
+
+    upgrade)
+       version=$2
+       export LANG=C   # for the comparison of mail version...
+
+       NFS_IN_USE=$(sed -n '/^[^ ]* [^ ]* nfs /p' /proc/mounts)
+       if [ -n "$NFS_IN_USE" ] && [ ! -x /usr/sbin/mount.nfs ]; then
+           cat << EOF
+You have NFS mounts, and this version of mount requires that nfs-common
+be upgraded before NFS mounts will work.
+
+Aborting install.
+EOF
+           exit 1
+       fi
+
+       ;;
+
+    abort-upgrade)
+       ;;
+
+    *)
+       echo "preinst called with unknown argument \`$1'" >&2
+       exit 1
+       ;;
+esac
+
+#DEBHELPER#
index 9b6fc8c7f0b4f79a3c3b343a785376e9b6fe4599..87cbf93f334e7de53fb3056a8640fb9c95d14c11 100755 (executable)
@@ -306,8 +306,9 @@ ifeq ($(DEB_HOST_ARCH_OS),linux)
        install -m 644 $(HISTORY) debian/tmp-mount/usr/share/doc/mount/changelog
        find debian/tmp-mount/usr/share/{doc,man} -type f | xargs gzip -9
        install -m 644 debian/copyright debian/tmp-mount/usr/share/doc/mount/copyright
-       install debian/mount.postinst debian/tmp-mount/DEBIAN/postinst
+       install debian/mount.preinst   debian/tmp-mount/DEBIAN/preinst
        install debian/mount.prerm   debian/tmp-mount/DEBIAN/prerm
+       install debian/mount.postinst debian/tmp-mount/DEBIAN/postinst
        ls debian/tmp-mount/{bin,sbin}/* | xargs dpkg-shlibdeps -pmount
        dpkg-gencontrol -isp -pmount -Pdebian/tmp-mount
        dpkg --build debian/tmp-mount ..