diff --git a/debian/mount.preinst b/debian/mount.preinst index a0dd43c..2910362 100644 --- a/debian/mount.preinst +++ b/debian/mount.preinst @@ -17,25 +17,22 @@ case "$1" in ;; upgrade) - version=$2 - DISTRO=$(lsb_release -is 2>/dev/null || echo Debian); - - if [ Debian = "$DISTRO" ]; then - if [ -f /proc/mounts ] && ! chrooted; then - NFS_IN_USE=$(sed -n '/^[^ ]* [^ ]* nfs /p' /proc/mounts) - else - NFS_IN_USE="" - fi - if [ -n "$NFS_IN_USE" ] && [ ! -x /sbin/mount.nfs ] ; then - cat << EOF +#DEBIAN_ONLY_BEGIN# + if [ -f /proc/mounts ] && ! chrooted; then + NFS_IN_USE=$(sed -n '/^[^ ]* [^ ]* nfs /p' /proc/mounts) + else + NFS_IN_USE="" + fi + if [ -n "$NFS_IN_USE" ] && [ ! -x /sbin/mount.nfs ] ; then + cat << EOF You have NFS mount points currently mounted, and this version of mount requires that nfs-common be upgraded before NFS mounts will work. Aborting install. EOF - exit 1 - fi + exit 1 fi +#DEBIAN_ONLY_END# ;; diff --git a/debian/rules b/debian/rules index c8239cd..f771e5f 100755 --- a/debian/rules +++ b/debian/rules @@ -164,6 +164,11 @@ binary-arch: build install [ -n "$(STRIP)" ] || dh_strip -s dh_makeshlibs -s dh_installdeb -s +ifeq ($(DISTRO),Debian) + sed -i '/^#DEBIAN_ONLY_/d' debian/mount/DEBIAN/preinst +else + sed -i '/^#DEBIAN_ONLY_BEGIN#/,/^#DEBIAN_ONLY_END#/d' debian/mount/DEBIAN/preinst +endif dh_shlibdeps -s ifeq ($(DEB_HOST_ARCH_OS),hurd) echo util-linux:Conflicts=getty >> debian/util-linux.substvars