From: LaMont Jones Date: Mon, 30 Jul 2007 14:09:52 +0000 (-0600) Subject: mount: fail in preinst if newer nfs-common is needed X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b22999d324dd14a83e9a799367db49fe035211a6;p=util-linux mount: fail in preinst if newer nfs-common is needed --- diff --git a/debian/changelog b/debian/changelog index 94a7f951..a96978c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 30 Jul 2007 01:01:08 -0600 + -- LaMont Jones 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 index 00000000..430f2e4a --- /dev/null +++ b/debian/mount.preinst @@ -0,0 +1,44 @@ +#!/bin/sh -e + +# Debian mount preinst +# LaMont Jones + +### 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# diff --git a/debian/rules b/debian/rules index 9b6fc8c7..87cbf93f 100755 --- a/debian/rules +++ b/debian/rules @@ -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 ..