From patchwork Thu Oct 17 07:37:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 284111 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 B62512C00CD for ; Thu, 17 Oct 2013 18:39:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F37A4A0CA; Thu, 17 Oct 2013 09:39:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 oQRTk3rGreOC; Thu, 17 Oct 2013 09:39:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC3424A0C2; Thu, 17 Oct 2013 09:38:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 53BBC4A09B for ; Thu, 17 Oct 2013 09:38:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 LINCpRStln6X for ; Thu, 17 Oct 2013 09:38:45 +0200 (CEST) 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 smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id CE2594A0A9 for ; Thu, 17 Oct 2013 09:38:36 +0200 (CEST) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id r9H7c96U028806; Thu, 17 Oct 2013 16:38:09 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili11) with ESMTP id r9H7c9R30064; Thu, 17 Oct 2013 16:38:09 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi12) id r9H7c93O021541; Thu, 17 Oct 2013 16:38:09 +0900 Received: from poodle by lomi12.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r9H7c8YH021500; Thu, 17 Oct 2013 16:38:08 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 9E6FB2743A5C; Thu, 17 Oct 2013 16:38:08 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 17 Oct 2013 16:37:42 +0900 Message-Id: <1381995462-32556-4-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381995462-32556-1-git-send-email-yamada.m@jp.panasonic.com> References: <1381995462-32556-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH 3/3] MAKEALL: fix boards_by_field function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 27af930e changed the boards.cfg format and it changed boards_by_field() function incorrectly. For tegra cpus it returned Board Name field, not Target field. Signed-off-by: Masahiro Yamada Cc: Albert ARIBAUD --- Commit 27af930e adjusted this part like follows: -v field="$1" \ -v select="$2" \ -F "$FS" \ - '($1 !~ /^#/ && $field == select) { print $1 }' \ + '($1 !~ /^#/ && $field == select) { print $7 }' \ boards.cfg } boards_by_arch() { boards_by_field 2 "$@" ; } boards_by_cpu() { boards_by_field 3 "$@" "[: \t]+" ; } -boards_by_soc() { boards_by_field 6 "$@" ; } +boards_by_soc() { boards_by_field 4 "$@" ; } TAB is also treated as a field speparator, so we should have taken the 8th field for Tegra whereas the 7th field for the other cpus. Fortunately, Board Name field and Target filed are the same for all Tegra LSIs. But we should not expect it. MAKEALL | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MAKEALL b/MAKEALL index 4f685e1..485721e 100755 --- a/MAKEALL +++ b/MAKEALL @@ -226,17 +226,17 @@ RC=0 # Helper funcs for parsing boards.cfg boards_by_field() { - FS="[ \t]+" - [ -n "$3" ] && FS="$3" awk \ -v field="$1" \ -v select="$2" \ - -F "$FS" \ - '($1 !~ /^#/ && $field == select) { print $7 }' \ + -v cut="$3" \ + '{sub(cut,"",$field)} + ($1 !~ /^#/ && $field == select) { print $7 }' \ boards.cfg } + boards_by_arch() { boards_by_field 2 "$@" ; } -boards_by_cpu() { boards_by_field 3 "$@" "[: \t]+" ; } +boards_by_cpu() { boards_by_field 3 "$@" ":.*" ; } boards_by_soc() { boards_by_field 4 "$@" ; } #########################################################################