From: Mike Frysinger Date: Sun, 17 Oct 2010 07:13:01 -0400 Subject: [U-Boot] [PATCH] MAKEALL: allow additional board selections In-Reply-To: <1287311493-10041-1-git-send-email-wd@denx.de> References: <1287311493-10041-1-git-send-email-wd@denx.de> Message-ID: <201010170713.02380.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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