[Mesa-dev] [PATCH] ABI-check: Use more portable bash invocation.

Eero Tamminen eero.t.tamminen at intel.com
Wed Aug 19 04:23:32 PDT 2015


Hi,

On 08/18/2015 08:59 PM, Matt Turner wrote:
> On Tue, Jul 21, 2015 at 2:08 PM, Vinson Lee <vlee at freedesktop.org> wrote:
>> Fixes 'make check' on FreeBSD.
>>
>> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
>> ---
>
> Seems fine to me.
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
>
> At the same time, I don't have any idea if the scripts actually rely
> on bash itself. I think I've heard that Debian has a tool to detect
> bash-dependencies in shell scripts that might be of some use.

Debian "devscripts" package contains "checkbashisms".

I've used it to make my own scripts POSIX / Busybox shell compliant and 
it has worked fine for me.


	- Eero

PS. About only Bashism that is hard to do in POSIX shell is array 
accesses.  E.g. most things where string slices are used, can also be 
done with POSIX string operations.  For example:
	extension=${str##*\.}
	if [ $extension = "gz" ]; then
	...

(Diligent shell programmer would have as first check:
	if [ "$extension" = "$str" ]; then
		# no extension
		return
	fi

)



More information about the mesa-dev mailing list