[pacman-dev] [PATCH 8/8][RFC]: bash version check

Dave Reisner dreisner at archlinux.org
Thu Apr 12 10:54:38 EDT 2012

This was on the top of my parse-opts branch. Figured I'd send it along to
see if anyone else cares about this sort of thing. Easily nuked...

Since we're using associative arrays in pacman-key, 4.0 is a requirement.
However, 4.0 is also full of bugs, so Allan and I agreed that 4.1 would
be a better minimum requirement to avoid unresolvable bug reports.

 configure.ac |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index a6114f8..b325fbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,7 +148,15 @@ AC_PROG_AWK
 AC_CHECK_PROGS([PYTHON], [python2.7 python2.6 python2.5 python2 python], [false])
-AC_PATH_PROGS([BASH_SHELL], [bash bash4 bash3], [false])
+AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false])
+AS_IF([test "x$BASH_SHELL" = "xfalse"],
+	AC_MSG_WARN([*** bash >= 4.1.0 is required for pacman scripts]),
+	[bash_version_majmin=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[0]]}${BASH_VERSINFO[[1]]}"'`
+	if test "$bash_version_majmin" -lt 41; then
+		AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts])
+	fi
+	unset bash_version_majmin])
 # find installed gettext
 AM_GNU_GETTEXT([external], [need-ngettext])

More information about the pacman-dev mailing list