From patchwork Mon Oct 21 02:11:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 285074 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 A84F02C0143 for ; Mon, 21 Oct 2013 13:12:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3D0F74A127; Mon, 21 Oct 2013 04:12:22 +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 Xn3qrFe4J0A7; Mon, 21 Oct 2013 04:12:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 23AFA4A129; Mon, 21 Oct 2013 04:12:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BAD94A108 for ; Mon, 21 Oct 2013 04:11:57 +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 szRyLVuHXH-K for ; Mon, 21 Oct 2013 04:11:56 +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 83CD04A11C for ; Mon, 21 Oct 2013 04:11:44 +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-maile11) with ESMTP id r9L2BUYT003543; Mon, 21 Oct 2013 11:11:30 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili16) with ESMTP id r9L2BUL18163; Mon, 21 Oct 2013 11:11:30 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id r9L2BUU8022651; Mon, 21 Oct 2013 11:11:30 +0900 Received: from poodle by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id r9L2BUnU022623; Mon, 21 Oct 2013 11:11:30 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 2B7E02743A5C; Mon, 21 Oct 2013 11:11:30 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 21 Oct 2013 11:11:27 +0900 Message-Id: <1382321488-16449-4-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1382321488-16449-1-git-send-email-yamada.m@jp.panasonic.com> References: <1382321488-16449-1-git-send-email-yamada.m@jp.panasonic.com> Subject: [U-Boot] [PATCH v2 3/4] 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. This commit restores the behavior prior to 27af930e in the right way. Signed-off-by: Masahiro Yamada Cc: Albert ARIBAUD --- Changes for v2: - Re-write boards_by_field and boards_by_cpu functions Albert says in the review of v1: > The way the code is written now, board_by_field() has to do the job of > board_by_cpu() and has to know the CPU field has colon-separated > subfields. What should be done is, board_by_field should not even worry > about colons at all, and it is board_by_cpu() which should know about > CPU dubfields and treat them properly. MAKEALL | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/MAKEALL b/MAKEALL index 230959c..5859361 100755 --- a/MAKEALL +++ b/MAKEALL @@ -226,17 +226,15 @@ 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 }' \ - boards.cfg + field=$1 + regexp=$2 + + awk '($1 !~ /^#/ && $'"$field"' ~ /^'"$regexp"'$/) { 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_field 3 "$@:.*" ; } boards_by_soc() { boards_by_field 4 "$@" ; } #########################################################################