diff mbox

[U-Boot,v3] scripts: fix binutils-version.sh for 'as' without a package.

Message ID 1420644855-19226-1-git-send-email-bpringlemeir@nbsps.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Bill Pringlemeir Jan. 7, 2015, 3:34 p.m. UTC
Commit 73c25753 fixed the common issue that binutil packages (tool/organization
that packaged or built the bin-utils) are included in brackets and this may
falsely be recognized as a version.  However, some tools do not provide a
'package' and previously we add the 'Gnu assembler..' to the version.

Strip out the '(package version text)' and then look for a ##.## string.

Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
---
 scripts/binutils-version.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Masahiro Yamada Jan. 8, 2015, 8:56 a.m. UTC | #1
On Wed,  7 Jan 2015 10:34:15 -0500
Bill Pringlemeir <bpringlemeir@nbsps.com> wrote:

> Commit 73c25753 fixed the common issue that binutil packages (tool/organization
> that packaged or built the bin-utils) are included in brackets and this may
> falsely be recognized as a version.  However, some tools do not provide a
> 'package' and previously we add the 'Gnu assembler..' to the version.
> 
> Strip out the '(package version text)' and then look for a ##.## string.
> 
> Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
> ---
>  scripts/binutils-version.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh
> index 0bc26cf..a343681 100755
> --- a/scripts/binutils-version.sh
> +++ b/scripts/binutils-version.sh
> @@ -14,7 +14,8 @@ if [ ${#gas} -eq 0 ]; then
>  	exit 1
>  fi
>  
> -version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' )
> +version_string=$($gas --version | head -1 | \
> +	sed -e 's/(.*)//; s/[^0-9.]*\([0-9.]*\).*/\1/')
>  
>  MAJOR=$(echo $version_string | cut -d . -f 1)
>  MINOR=$(echo $version_string | cut -d . -f 2)
> -- 
> 1.8.0.2


Tested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Hans de Goede Jan. 8, 2015, 10:18 a.m. UTC | #2
Hi,

On 07-01-15 16:34, Bill Pringlemeir wrote:
> Commit 73c25753 fixed the common issue that binutil packages (tool/organization
> that packaged or built the bin-utils) are included in brackets and this may
> falsely be recognized as a version.  However, some tools do not provide a
> 'package' and previously we add the 'Gnu assembler..' to the version.
>
> Strip out the '(package version text)' and then look for a ##.## string.
>
> Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>

Thanks, this fixes the errors I was seeing:

Tested-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans
Tom Rini Jan. 9, 2015, 1:34 p.m. UTC | #3
On Wed, Jan 07, 2015 at 10:34:15AM -0500, Bill Pringlemeir wrote:

> Commit 73c25753 fixed the common issue that binutil packages (tool/organization
> that packaged or built the bin-utils) are included in brackets and this may
> falsely be recognized as a version.  However, some tools do not provide a
> 'package' and previously we add the 'Gnu assembler..' to the version.
> 
> Strip out the '(package version text)' and then look for a ##.## string.
> 
> Signed-off-by: Bill Pringlemeir <bpringlemeir@nbsps.com>
> Tested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Tested-by: Hans de Goede <hdegoede@redhat.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh
index 0bc26cf..a343681 100755
--- a/scripts/binutils-version.sh
+++ b/scripts/binutils-version.sh
@@ -14,7 +14,8 @@  if [ ${#gas} -eq 0 ]; then
 	exit 1
 fi
 
-version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' )
+version_string=$($gas --version | head -1 | \
+	sed -e 's/(.*)//; s/[^0-9.]*\([0-9.]*\).*/\1/')
 
 MAJOR=$(echo $version_string | cut -d . -f 1)
 MINOR=$(echo $version_string | cut -d . -f 2)