Commit b6b1b44586778885f37e1a2f2b17da7ddb04d565

Authored by Bill Pringlemeir
Committed by Tom Rini
1 parent b4ad44baab

scripts: fix binutils-version.sh for 'as' without a package.

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

scripts/binutils-version.sh
... ... @@ -14,7 +14,8 @@
14 14 exit 1
15 15 fi
16 16  
17   -version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' )
  17 +version_string=$($gas --version | head -1 | \
  18 + sed -e 's/(.*)//; s/[^0-9.]*\([0-9.]*\).*/\1/')
18 19  
19 20 MAJOR=$(echo $version_string | cut -d . -f 1)
20 21 MINOR=$(echo $version_string | cut -d . -f 2)