scripts: fix binutils-version.sh
PATCH 1/1 scripts: fix binutils-version.sh
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.
---
scripts/binutils-version.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/binutils-version.sh +4 -2
@@ -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
Signature · 1 line
1.9.1
PATCH 1/1 scripts: fix binutils-version.sh
Quoted 9 lines · Masahiro Yamada
The current
binutils-version.shexpects 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 <[email protected]>Reported-by York Sun <[email protected]>
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
Quoted 22 lines
---
scripts/binutils-version.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)scripts/binutils-version.sh +4
-2@@ -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
Quoted 10 lines · Masahiro Yamada
The current
binutils-version.shexpects 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 <[email protected]>Reported-by York Sun <[email protected]>Acked-by Dirk Behme <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
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>