[U-Boot] [PATCH] MAKEALL: allow additional board selections

Mike Frysinger vapier at gentoo.org
Sun Oct 17 13:13:01 CEST 2010


On Sunday, October 17, 2010 06:31:33 Wolfgang Denk wrote:
> +TEMP=`getopt -o a:c:v:s: --long arch:,cpu:,vendor:,soc: \
> +     -n 'MAKEALL' -- "$@"`

perhaps split the short/long opts out into dedicated variables to make 
updating easier ?

SHORT_OPTS="a:c:v:s:"
LONG_OPTS="arch:,cpu:,vendor:,soc:"
...
TEMP=`getopt -o ${SHORT_OPTS} --long ${LONG_OPTS} ......

> +while true ; do
> +        case "$1" in
> +	-a|--arch)

mixing of spaces & tabs for indentation ...

> +		echo "Internal error!" ; exit 1 ;;

send to stderr ?
	echo ... 1>&2

> +# echo "Remaining arguments:"
> +# for arg do echo '--> '"\`$arg'" ; done

the for loop can be done in a single printf:
	printf '--> '"\`%s'\n" "$@"

> +	SELECTED="$(awk '('"$FILTER"') { print $1 }' boards.cfg)"

dont really need the outermost quotes:
	var=$(echo a b c)
works just fine

> -#----- for now, just run PowerPC by default -----
> -[ $# = 0 ] && set -- powerpc
> +# Build target groups selected by options, plus any command line args
> +if [ "$SELECTED" ] ; then
> +	build_targets $SELECTED "$@"
> +else
> +	# run PowerPC by default
> +	[ $# = 0 ] && set -- powerpc
> 
> -build_targets "$@"
> +	build_targets "$@"
> +fi

i dont think you need to be so stringent about the value of SELECTED.  this 
should the same:
# Build target groups selected by options, plus any command line args
set -- ${SELECTED} "$@"
# run PowerPC by default
[ $# = 0 ] && set -- powerpc
build_targets "$@"
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101017/fc7593ec/attachment.pgp 


More information about the U-Boot mailing list