From patchwork Wed Jan 7 15:34:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Pringlemeir X-Patchwork-Id: 426283 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3E5D11400D5 for ; Thu, 8 Jan 2015 02:37:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B662A4B61F; Wed, 7 Jan 2015 16:37:32 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1lODtxs2UPBo; Wed, 7 Jan 2015 16:37:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA7064B610; Wed, 7 Jan 2015 16:37:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A0354B610 for ; Wed, 7 Jan 2015 16:37:27 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dVf90TXUxAlr for ; Wed, 7 Jan 2015 16:37:26 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from nsa.nbspaymentsolutions.com (71-19-161-253.dedicated.allstream.net [71.19.161.253]) by theia.denx.de (Postfix) with ESMTP id 9F38C4B600 for ; Wed, 7 Jan 2015 16:37:23 +0100 (CET) Received: from ps-bpringlemeir1.nbspaymentsolutions.com (unknown [172.20.177.82]) by nsa.nbspaymentsolutions.com (Postfix) with ESMTP id A264E3FC437; Wed, 7 Jan 2015 10:42:25 -0500 (EST) From: Bill Pringlemeir To: U-Boot Date: Wed, 7 Jan 2015 10:34:15 -0500 Message-Id: <1420644855-19226-1-git-send-email-bpringlemeir@nbsps.com> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <20150107210129.B9C2.AA925319@jp.panasonic.com> References: <20150107210129.B9C2.AA925319@jp.panasonic.com> Cc: Tom Rini Subject: [U-Boot] [PATCH v3] scripts: fix binutils-version.sh for 'as' without a package. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Tested-by: Masahiro Yamada Tested-by: Hans de Goede --- scripts/binutils-version.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh index 0bc26cf..a343681 100755 --- a/scripts/binutils-version.sh +++ b/scripts/binutils-version.sh @@ -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)