All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] scripts: fix binutils-version.sh
@ 2014-12-25  2:09 Masahiro Yamada
  2014-12-25  6:58 ` Dirk Behme
  2014-12-30  2:27 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2014-12-25  2:09 UTC (permalink / raw)
  To: u-boot

The current binutils-version.sh expects the version string at the end
of the first line.  It turned out to not work with Linaro toolchain:
It has "Linaro 2014.09" at the back.

To fix this issue, let's parse the word right after the close
parenthesis.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: York Sun <yorksun@freescale.com>
---

 scripts/binutils-version.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] scripts: fix binutils-version.sh
  2014-12-25  2:09 [U-Boot] [PATCH] scripts: fix binutils-version.sh Masahiro Yamada
@ 2014-12-25  6:58 ` Dirk Behme
  2014-12-30  2:27 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Dirk Behme @ 2014-12-25  6:58 UTC (permalink / raw)
  To: u-boot

On 25.12.2014 03:09, Masahiro Yamada wrote:
> The current binutils-version.sh expects the version string at the end
> of the first line.  It turned out to not work with Linaro toolchain:
> It has "Linaro 2014.09" at the back.
>
> To fix this issue, let's parse the word right after the close
> parenthesis.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Reported-by: York Sun <yorksun@freescale.com>

Acked-by: Dirk Behme <dirk.behme@gmail.com>

This fixes the issue [1] for me :)

I'd propose to apply this to 2015.01-rc3.

Thanks!

Dirk

[1] http://lists.denx.de/pipermail/u-boot/2014-December/199515.html

> ---
>
>   scripts/binutils-version.sh | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh
> index d4d9eb4..0bc26cf 100755
> --- a/scripts/binutils-version.sh
> +++ b/scripts/binutils-version.sh
> @@ -14,7 +14,9 @@ if [ ${#gas} -eq 0 ]; then
>   	exit 1
>   fi
>
> -MAJOR=$($gas --version | head -1 | awk '{print $NF}' | cut -d . -f 1)
> -MINOR=$($gas --version | head -1 | awk '{print $NF}' | cut -d . -f 2)
> +version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' )
> +
> +MAJOR=$(echo $version_string | cut -d . -f 1)
> +MINOR=$(echo $version_string | cut -d . -f 2)
>
>   printf "%02d%02d\\n" $MAJOR $MINOR
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] scripts: fix binutils-version.sh
  2014-12-25  2:09 [U-Boot] [PATCH] scripts: fix binutils-version.sh Masahiro Yamada
  2014-12-25  6:58 ` Dirk Behme
@ 2014-12-30  2:27 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2014-12-30  2:27 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 25, 2014 at 11:09:44AM +0900, Masahiro Yamada wrote:

> The current binutils-version.sh expects the version string at the end
> of the first line.  It turned out to not work with Linaro toolchain:
> It has "Linaro 2014.09" at the back.
> 
> To fix this issue, let's parse the word right after the close
> parenthesis.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Reported-by: York Sun <yorksun@freescale.com>
> Acked-by: Dirk Behme <dirk.behme@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141229/c455ecd7/attachment.pgp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-30  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-25  2:09 [U-Boot] [PATCH] scripts: fix binutils-version.sh Masahiro Yamada
2014-12-25  6:58 ` Dirk Behme
2014-12-30  2:27 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.