[U-Boot] [PATCH v2 3/4] MAKEALL: fix boards_by_field function
Masahiro Yamada
yamada.m at jp.panasonic.com
Mon Oct 21 04:11:27 CEST 2013
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 <yamada.m at jp.panasonic.com>
Cc: Albert ARIBAUD <albert.u.boot at aribaud.net>
---
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 "$@" ; }
#########################################################################
--
1.8.1.2
More information about the U-Boot
mailing list