Make test for util-linux version more robust
authorNikolaus Rath <Nikolaus@rath.org>
Thu, 10 Nov 2016 21:11:57 +0000 (13:11 -0800)
committerNikolaus Rath <Nikolaus@rath.org>
Thu, 10 Nov 2016 21:11:57 +0000 (13:11 -0800)
The current version fails on Amazon Linux. This check should work
better.

Fixes #64.

ChangeLog.rst
configure.ac

index 6e258725b927e3e6b643af49f5d1c8dc26cb8612..7f38ee142e30d59d066ef676f66329ede8894576 100644 (file)
@@ -3,6 +3,8 @@ UNRELEASED CHANGES
 
 * Fixed test errors when running tests as root.
 
+* Made check for util-linux version more robust.
+
 FUSE 3.0.0-rc2 (2016-11-06)
 ===========================
 
index a009c0b8a0a4ae2428d17415ff277e5954b5b204..cd9ae75db47dd69a058054d541774186f413f984 100644 (file)
@@ -109,20 +109,14 @@ AM_CONDITIONAL(BSD, test "$arch" = bsd)
 
 util_linux_ok=yes
 if test "$arch" = linux -a "$cross_compiling" != "yes"; then
-       AC_MSG_CHECKING([if umount supports --fake --no-canonicalize])
-       # exit code of umount is 1 if option is unrecognised, 2 otherwise
-       umount --fake --no-canonicalize > /dev/null 2>&1
-       if test $? != 1; then
-               AC_MSG_RESULT([yes])
-       else
-               firstline=`umount --fake --no-canonicalize 2>&1 | head -1`
-               if test "$firstline" = 'umount: only root can use "--fake" option'; then
-                       AC_MSG_RESULT([yes])
-               else
-                       AC_MSG_RESULT([$firstline])
-                       util_linux_ok=no
-               fi
-       fi
+        AC_MSG_CHECKING([if umount supports --fake --no-canonicalize])
+        if umount --help 2>&1 | grep -q -- "--fake" &&
+           umount --help 2>&1 | grep -q -- "--no-canonicalize"; then
+                AC_MSG_RESULT([yes])
+        else
+                AC_MSG_RESULT([no])
+                util_linux_ok=no
+        fi
 fi
 
 AC_CONFIG_FILES([fuse3.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile doc/Makefile test/Makefile])