[U-Boot] [PATCH] mkconfig: deny messed up ARCH definition

Wolfgang Denk wd at denx.de
Sun Nov 1 15:57:40 CET 2009


Dear Mike Frysinger,

In message <200911010838.08938.vapier at gentoo.org> you wrote:
>
> > > > +if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
> > >
> > > is the !-z really needed ?
> > 
> > We don't want the check to trigger if ARCH is not defined.
> > [ "$ARCH" != "$2" ] will trigger as "" != "arm"
>
> the implied question is whether this is a valid state.  i know you dont wan> t 
> that kind of comparison, but i thought the Makefile would have set it up fo> r 
> you by default.  now that i think about it a bit more, that isnt what happe> ns 
> at all.
>
> so only thing to change here is to use -n and not !-z

Or even omit the (redundant) "-n" and just write

	if [ "$ARCH" -a "$ARCH" != "$2" ]; then
		...
	

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Use the Force, Luke.


More information about the U-Boot mailing list