Patchwork [U-Boot] MAKEALL: Fix case substitution for old bash

login
register
mail settings
Submitter York Sun
Date March 22, 2013, 5:37 p.m.
Message ID <1363973823-26290-1-git-send-email-yorksun@freescale.com>
Download mbox | patch
Permalink /patch/230214/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

York Sun - March 22, 2013, 5:37 p.m.
Bash ver 3.x doesn't support the parameter expansion with case
substitution. Use tr instead.

Signed-off-by: York Sun <yorksun@freescale.com>
---
Removed RFC from subject line.

 MAKEALL |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Allen Martin - March 27, 2013, 4:46 p.m.
On Fri, Mar 22, 2013 at 10:37:03AM -0700, York Sun wrote:
> Bash ver 3.x doesn't support the parameter expansion with case
> substitution. Use tr instead.
> 
> Signed-off-by: York Sun <yorksun@freescale.com>

Acked-by: Allen Martin <amartin@nvidia.com>



> ---
> Removed RFC from subject line.
> 
>  MAKEALL |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MAKEALL b/MAKEALL
> index c1d8957..ac92ef6 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -664,7 +664,7 @@ build_target() {
>  	export BUILD_DIR="${output_dir}"
>  
>  	target_arch=$(get_target_arch ${target})
> -	eval cross_toolchain=\$CROSS_COMPILE_${target_arch^^}
> +	eval cross_toolchain=\$CROSS_COMPILE_`echo $target_arch | tr '[:lower:]' '[:upper:]'`
>  	if [ "${cross_toolchain}" ] ; then
>  	    MAKE="make CROSS_COMPILE=${cross_toolchain}"
>  	elif [ "${CROSS_COMPILE}" ] ; then
> -- 
> 1.7.9.5
> 
>
Tom Rini - April 3, 2013, 3:30 p.m.
On Fri, Mar 22, 2013 at 07:37:03AM -0000, York Sun wrote:

> Bash ver 3.x doesn't support the parameter expansion with case
> substitution. Use tr instead.
> 
> Signed-off-by: York Sun <yorksun@freescale.com>
> Acked-by: Allen Martin <amartin@nvidia.com>

Applied to u-boot/master, thanks!

Patch

diff --git a/MAKEALL b/MAKEALL
index c1d8957..ac92ef6 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -664,7 +664,7 @@  build_target() {
 	export BUILD_DIR="${output_dir}"
 
 	target_arch=$(get_target_arch ${target})
-	eval cross_toolchain=\$CROSS_COMPILE_${target_arch^^}
+	eval cross_toolchain=\$CROSS_COMPILE_`echo $target_arch | tr '[:lower:]' '[:upper:]'`
 	if [ "${cross_toolchain}" ] ; then
 	    MAKE="make CROSS_COMPILE=${cross_toolchain}"
 	elif [ "${CROSS_COMPILE}" ] ; then