Skip to content

Commit

Permalink
scripts: fix binutils-version.sh for 'as' without a package.
Browse files Browse the repository at this point in the history
Commit 73c2575 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 <[email protected]>
Tested-by: Masahiro Yamada <[email protected]>
Tested-by: Hans de Goede <[email protected]>
  • Loading branch information
Bill Pringlemeir authored and trini committed Jan 8, 2015
1 parent b4ad44b commit b6b1b44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/binutils-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6b1b44

Please sign in to comment.