public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
@ 2009-10-31 14:12 Nishanth Menon
  2009-10-31 21:40 ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2009-10-31 14:12 UTC (permalink / raw)
  To: u-boot

Refuse to setup a platform if the command
line ARCH= is not the same as the one
required for the board. This prevents
any user with prehistoric aliases from
messing up thier builds

Reported in thread:
http://old.nabble.com/-U-Boot--Build-breaks-on-some-OMAP3-configs-to26132721.html

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 mkconfig |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/mkconfig b/mkconfig
index 4c5675b..87ac6d4 100755
--- a/mkconfig
+++ b/mkconfig
@@ -27,6 +27,11 @@ done
 [ $# -lt 4 ] && exit 1
 [ $# -gt 6 ] && exit 1
 
+if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then
+	echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail" 
+	exit 1
+fi
+
 echo "Configuring for ${BOARD_NAME} board..."
 
 #
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
  2009-10-31 14:12 [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition Nishanth Menon
@ 2009-10-31 21:40 ` Mike Frysinger
  2009-10-31 22:20   ` Menon, Nishanth
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2009-10-31 21:40 UTC (permalink / raw)
  To: u-boot

On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
> Refuse to setup a platform if the command
> line ARCH= is not the same as the one
> required for the board. This prevents
> any user with prehistoric aliases from
> messing up thier builds

seems like excessive line wrapping

> +if [ ! -z "$ARCH" -a "$ARCH" != "$2" ]; then

is the !-z really needed ?

> +	echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"

should be sent to stderr: 1>&2
-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/20091031/aca0c43e/attachment.pgp 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
  2009-10-31 21:40 ` Mike Frysinger
@ 2009-10-31 22:20   ` Menon, Nishanth
  2009-11-01 13:38     ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Menon, Nishanth @ 2009-10-31 22:20 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Mike Frysinger [mailto:vapier at gentoo.org]
> Sent: Saturday, October 31, 2009 11:41 PM
> To: u-boot at lists.denx.de
> Cc: Menon, Nishanth; Gadiyar, Anand
> Subject: Re: [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
> 
> On Saturday 31 October 2009 10:12:01 Nishanth Menon wrote:
> > Refuse to setup a platform if the command
> > line ARCH= is not the same as the one
> > required for the board. This prevents
> > any user with prehistoric aliases from
> > messing up thier builds
> 
> seems like excessive line wrapping
Ok.. will stick with 70 chars..

> 
> > +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"

> 
> > +	echo "ARCH=$ARCH while ${BOARD_NAME} arch=$2: fail"
> 
> should be sent to stderr: 1>&2
Ack.

Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
  2009-10-31 22:20   ` Menon, Nishanth
@ 2009-11-01 13:38     ` Mike Frysinger
  2009-11-01 14:57       ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2009-11-01 13:38 UTC (permalink / raw)
  To: u-boot

On Saturday 31 October 2009 18:20:06 Menon, Nishanth wrote:
> From: Mike Frysinger
> > On Saturday 31 October 2009 10:12:01 Nishanth Menon 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 want 
that kind of comparison, but i thought the Makefile would have set it up for 
you by default.  now that i think about it a bit more, that isnt what happens 
at all.

so only thing to change here is to use -n and not !-z
-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/20091101/e64b37c3/attachment.pgp 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
  2009-11-01 13:38     ` Mike Frysinger
@ 2009-11-01 14:57       ` Wolfgang Denk
  2009-11-02 15:26         ` Menon, Nishanth
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2009-11-01 14:57 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <200911010838.08938.vapier@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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition
  2009-11-01 14:57       ` Wolfgang Denk
@ 2009-11-02 15:26         ` Menon, Nishanth
  0 siblings, 0 replies; 6+ messages in thread
From: Menon, Nishanth @ 2009-11-02 15:26 UTC (permalink / raw)
  To: u-boot


> From: Wolfgang Denk [mailto:wd at denx.de]
> Sent: Sunday, November 01, 2009 8:58 AM
> 
> Dear Mike Frysinger,
> 
> In message <200911010838.08938.vapier@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
Ack. V2 coming up

Regards,
Nishanth Menon

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-11-02 15:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-31 14:12 [U-Boot] [PATCH] mkconfig: deny messed up ARCH definition Nishanth Menon
2009-10-31 21:40 ` Mike Frysinger
2009-10-31 22:20   ` Menon, Nishanth
2009-11-01 13:38     ` Mike Frysinger
2009-11-01 14:57       ` Wolfgang Denk
2009-11-02 15:26         ` Menon, Nishanth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox