From patchwork Tue Jan 6 22:38:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Pringlemeir X-Patchwork-Id: 425863 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 E0356140077 for ; Wed, 7 Jan 2015 09:40:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BD9864B5EB; Tue, 6 Jan 2015 23:40:48 +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 uoAgFkQh0r0A; Tue, 6 Jan 2015 23:40:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D4F364B5FA; Tue, 6 Jan 2015 23:40:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9653B4B5FA for ; Tue, 6 Jan 2015 23:40:44 +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 qjVJxL-XgLo7 for ; Tue, 6 Jan 2015 23:40:44 +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 2D47D4B5EB for ; Tue, 6 Jan 2015 23:40:40 +0100 (CET) Received: from ps-bpringlemeir1.nbspaymentsolutions.com (unknown [172.20.177.82]) by nsa.nbspaymentsolutions.com (Postfix) with ESMTP id 0CBDB3FC437; Tue, 6 Jan 2015 17:45:43 -0500 (EST) From: Bill Pringlemeir To: U-Boot Date: Tue, 6 Jan 2015 17:38:19 -0500 Message-Id: <1420583899-15338-1-git-send-email-bpringlemeir@nbsps.com> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1420583133-15012-1-git-send-email-bpringlemeir@nbsps.com> References: <1420583133-15012-1-git-send-email-bpringlemeir@nbsps.com> Cc: Tom Rini Subject: [U-Boot] [PATCH] 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. Run a 2nd pass on the 'version_string' to strip off any leading characters when a package is not provided in brackets. Signed-off-by: Bill Pringlemeir --- scripts/binutils-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/binutils-version.sh b/scripts/binutils-version.sh index 0bc26cf..b1afc98 100755 --- a/scripts/binutils-version.sh +++ b/scripts/binutils-version.sh @@ -5,7 +5,6 @@ # Prints the binutils version of `gas-command' in a canonical 4-digit form # such as `0222' for binutils 2.22 # - gas="$*" if [ ${#gas} -eq 0 ]; then @@ -15,6 +14,7 @@ if [ ${#gas} -eq 0 ]; then fi version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' ) +version_string=$(echo "$version_string" | sed -e 's/[^0-9]*\([0-9.]*\).*/\1/') MAJOR=$(echo $version_string | cut -d . -f 1) MINOR=$(echo $version_string | cut -d . -f 2)