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

Aaron Campbell aaron at monkey.org
Wed Nov 4 19:08:01 UTC 2015


On Nov 4, 2015, at 2:48 PM, Dave Reisner <d at falconindy.com> wrote:

> On Wed, Nov 04, 2015 at 02:32:09PM -0400, Aaron Campbell wrote:
>> 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>
> 
> If it's only a single instance, it seems to me it'd be simpler to just
> fix the usage rather than bump the bash requirement. Negative subscripts
> are a convenience feature, not a necessity.
> 
> 4.2 brings with it support for:
> 
> - %(fmt)T printf formatting (roughly strftime)
> - backslashes escapes for unicode
> - declare -g
> - test -v
> - lastpipe
> 
> Which are essentially all convenience methods for otherwise available
> functionality. No strong reason to want this…

Yep, if it’s a single instance, I agree.  I wasn’t sure, and I don’t actually use
Arch Linux myself, so I was a bit reluctant to make a lint change without a
convenient way to rebuild the existing packages.

-Aaron

> 
>> ---
>> 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