[Linaro-uefi,v2,1/1] atf-build.sh: fix to calculate atf version

Message ID 1539924674-32586-2-git-send-email-haojian.zhuang@linaro.org
State New
Headers show
Series
  • fix the calculation of ATF version
Related show

Commit Message

Haojian Zhuang Oct. 19, 2018, 4:51 a.m.
commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa
Author: Soby Mathew <soby.mathew@arm.com>
Date:   Mon Oct 1 16:16:34 2018 +0100

    Update the version to 2.0

    Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d
    Signed-off-by: Soby Mathew <soby.mathew@arm.com>

Since ARM Trusted Firmware version is updated to 2.0, the calculation
of ATF is wrong. It could only calculate version for 1.x.

Update the calculation to support 2.x or n.x.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
---
 atf-build.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Leif Lindholm Oct. 19, 2018, 5:50 a.m. | #1
On Fri, Oct 19, 2018 at 12:51:14PM +0800, Haojian Zhuang wrote:
> commit 1a0f11213a539a5d0c5d05bfaa68ccc75cb340aa
> Author: Soby Mathew <soby.mathew@arm.com>
> Date:   Mon Oct 1 16:16:34 2018 +0100
> 
>     Update the version to 2.0
> 
>     Change-Id: Icbc556d47a58d0870577b1bf1cd27cc5827fd56d
>     Signed-off-by: Soby Mathew <soby.mathew@arm.com>
> 
> Since ARM Trusted Firmware version is updated to 2.0, the calculation
> of ATF is wrong. It could only calculate version for 1.x.
> 
> Update the calculation to support 2.x or n.x.
> 
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Pushed as 341ba90. Thanks.

> ---
>  atf-build.sh | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/atf-build.sh b/atf-build.sh
> index fb80ad0..30af714 100755
> --- a/atf-build.sh
> +++ b/atf-build.sh
> @@ -27,7 +27,11 @@ function check_atf_buildver
>  	MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'`
>  	[ $? -ne 0 ] && return 1
>  
> -	if [ "$MAJOR" -eq 1 -a "$MINOR" -ge 2 ]; then
> +	if [ "$MAJOR" -eq 1 ]; then
> +		if [ "$MINOR" -ge 2 ]; then
> +			ATF_BUILDVER=2
> +		fi
> +	else
>  		ATF_BUILDVER=2
>  	fi
>  }
> -- 
> 2.7.4
>

Patch

diff --git a/atf-build.sh b/atf-build.sh
index fb80ad0..30af714 100755
--- a/atf-build.sh
+++ b/atf-build.sh
@@ -27,7 +27,11 @@  function check_atf_buildver
 	MINOR=`grep "^VERSION_MINOR" Makefile | sed 's/.*:= *\([0-9]*\).*/\1/'`
 	[ $? -ne 0 ] && return 1
 
-	if [ "$MAJOR" -eq 1 -a "$MINOR" -ge 2 ]; then
+	if [ "$MAJOR" -eq 1 ]; then
+		if [ "$MINOR" -ge 2 ]; then
+			ATF_BUILDVER=2
+		fi
+	else
 		ATF_BUILDVER=2
 	fi
 }