[pacman-dev] [PATCH] Bump minimum required bash version to 4.2

Aaron Campbell aaron at monkey.org
Wed Nov 4 18:32:09 UTC 2015


4.1 does not have support for negative subscripts to indexed arrays (a feature
that makepkg depends on).

>From the bash CHANGES log list of changes between 4.1-release and 4.2-alpha:

    Negative subscripts to indexed arrays, previously errors, now are treated
    as offsets from the maximum assigned index + 1.

Fixes "/usr/bin/makepkg: line 2774: idx: bad array subscript" seen w/ 4.1.

Signed-off-by: Aaron Campbell <aaron at monkey.org>
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 359d61b..a8d339c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,18 +183,18 @@ AC_DEFUN([AX_PROG_PERL_VERSION],
 AX_PROG_PERL_VERSION([5.10.1], [], [AC_MSG_ERROR([perl is too old])])
 
 AS_IF([test "x$BASH_SHELL" = "xfalse"],
-	AC_MSG_WARN([*** bash >= 4.1.0 is required for pacman scripts]),
+	AC_MSG_WARN([*** bash >= 4.2.0 is required for pacman scripts]),
 	[bash_version_major=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[0]]}"'`
 	bash_version_minor=`$BASH_SHELL -c 'echo "${BASH_VERSINFO[[1]]}"'`
 	ok=yes
 	if test "$bash_version_major" -lt 4; then
 		ok=no
 	fi
-	if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 1; then
+	if test "$bash_version_major" -eq 4 && test "$bash_version_minor" -lt 2; then
 		ok=no
 	fi
 	if test "$ok" = "no"; then
-		AC_MSG_ERROR([*** bash >= 4.1.0 is required for pacman scripts])
+		AC_MSG_ERROR([*** bash >= 4.2.0 is required for pacman scripts])
 	fi
 	unset bash_version_major bash_version_minor ok])
 
-- 
2.5.0


More information about the pacman-dev mailing list