From c41492ee4764a40c4b799ab506809aae39851cbb Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Fri, 24 May 2019 16:21:05 -0500 Subject: [PATCH] Eliminate a ./configure bashism configure uses /bin/sh, which is not necessarily bash. Fixes #8809 Signed-off-by: Richard Laager --- config/always-python.m4 | 8 ++++---- config/always-pyzfs.m4 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/always-python.m4 b/config/always-python.m4 index 858ab7b01582..da57b40b0e0b 100644 --- a/config/always-python.m4 +++ b/config/always-python.m4 @@ -68,19 +68,19 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [ AM_PATH_PYTHON([2.6], [], [:]) AM_CONDITIONAL([USING_PYTHON], [test "$PYTHON" != :]) - AM_CONDITIONAL([USING_PYTHON_2], [test "${PYTHON_VERSION:0:2}" = "2."]) - AM_CONDITIONAL([USING_PYTHON_3], [test "${PYTHON_VERSION:0:2}" = "3."]) + AM_CONDITIONAL([USING_PYTHON_2], [echo "${PYTHON_VERSION}" | grep -q "^2\\."]) + AM_CONDITIONAL([USING_PYTHON_3], [echo "${PYTHON_VERSION}" | grep -q "^3\\."]) dnl # dnl # Minimum supported Python versions for utilities: dnl # Python 2.6.x, or Python 3.4.x dnl # - AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [ + AS_IF([echo "${PYTHON_VERSION}" | grep -q "^2\\."], [ ZFS_AC_PYTHON_VERSION([>= '2.6'], [ /bin/true ], [AC_MSG_ERROR("Python >= 2.6.x is not available")]) ]) - AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [ + AS_IF([echo "${PYTHON_VERSION}" | grep -q "^3\\."], [ ZFS_AC_PYTHON_VERSION([>= '3.4'], [ /bin/true ], [AC_MSG_ERROR("Python >= 3.4.x is not available")]) ]) diff --git a/config/always-pyzfs.m4 b/config/always-pyzfs.m4 index d74d6f1a756a..b193fba8fedc 100644 --- a/config/always-pyzfs.m4 +++ b/config/always-pyzfs.m4 @@ -26,10 +26,10 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [ dnl # Require python-devel libraries dnl # AS_IF([test "x$enable_pyzfs" = xcheck -o "x$enable_pyzfs" = xyes], [ - AS_IF([test "${PYTHON_VERSION:0:2}" = "2."], [ + AS_IF([echo "${PYTHON_VERSION}" | grep -q "^2\\."], [ PYTHON_REQUIRED_VERSION=">= '2.7.0'" ], [ - AS_IF([test "${PYTHON_VERSION:0:2}" = "3."], [ + AS_IF([echo "${PYTHON_VERSION}" | grep -q "^3\\."], [ PYTHON_REQUIRED_VERSION=">= '3.4.0'" ], [ AC_MSG_ERROR("Python $PYTHON_VERSION unknown")