X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=scripts%2Fbinutils-version.sh;h=a34368184f9ce8875e40b95bbb542f1507151e1c;hb=005c1cf888a7ad72bd0f9ceb6f6b2eee7720f7b0;hp=d4d9eb43619b331277104564c19c082eff319597;hpb=7f673c99c2d8d1aa21996c5b914f06d784b080ca;p=oweals%2Fu-boot.git diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh old mode 100644 new mode 100755 index d4d9eb4361..a34368184f --- 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