diff options
Diffstat (limited to 'scripts/binutils-version.sh')
-rwxr-xr-x[-rw-r--r--] | scripts/binutils-version.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh index d4d9eb4361..a34368184f 100644..100755 --- a/scripts/binutils-version.sh +++ b/scripts/binutils-version.sh @@ -14,7 +14,10 @@ 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/(.*)//; s/[^0-9.]*\([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 |