[pacman-dev,v2,1/3] configure: bump the minimum version of bash to 4.4

Message ID 20180619202635.24426-1-eschwartz@archlinux.org
State Accepted, archived
Headers show
Series [pacman-dev,v2,1/3] configure: bump the minimum version of bash to 4.4 | expand

Commit Message

Eli Schwartz June 19, 2018, 8:26 p.m. UTC
This is required in order to use declare -g and ${var@a}

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Luke Shumaker July 12, 2018, 5:30 a.m. UTC | #1
On Tue, 19 Jun 2018 16:26:33 -0400,
Eli Schwartz wrote:
> This is required in order to use declare -g and ${var@a}

Huh?  It's needed for @a, but wasn't `declare -g` in Bash 4.2?
Eli Schwartz July 12, 2018, 5:40 a.m. UTC | #2
On 07/12/2018 01:30 AM, Luke Shumaker wrote:
> On Tue, 19 Jun 2018 16:26:33 -0400,
> Eli Schwartz wrote:
>> This is required in order to use declare -g and ${var@a}
> 
> Huh?  It's needed for @a, but wasn't `declare -g` in Bash 4.2?

We moved from bash 4.1, it's quite genuine to say that moving from bash
4.1 to bash 4.4 enables using declare -g.

Patch

diff --git a/configure.ac b/configure.ac
index fb9d18e1..6ba9d737 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,18 +193,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.4.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 4; 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.4.0 is required for pacman scripts])
 	fi
 	unset bash_version_major bash_version_minor ok])