public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.23-git] toplevel Makefile/depmod bugfix
@ 2007-10-20  4:42 David Brownell
  2007-10-20  5:36 ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2007-10-20  4:42 UTC (permalink / raw)
  To: linux-kernel

This removes a BASH syntax error (seen building on Ubuntu Feisty).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

--- g26.orig/Makefile	2007-10-19 21:29:43.000000000 -0700
+++ g26/Makefile	2007-10-19 18:35:32.000000000 -0700
@@ -1507,7 +1507,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm
 # and we build for the host arch
 quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
       cmd_depmod = \
-	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" == "$(ARCH)" ]; then \
+	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" = "$(ARCH)" ]; then \
 		$(DEPMOD) -ae -F System.map                                     \
 		$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r)   \
 		$(KERNELRELEASE);                                               \

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

* Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix
  2007-10-20  4:42 [patch 2.6.23-git] toplevel Makefile/depmod bugfix David Brownell
@ 2007-10-20  5:36 ` Sam Ravnborg
  2007-10-20  5:44   ` Roland Dreier
  2007-10-20  5:52   ` David Brownell
  0 siblings, 2 replies; 5+ messages in thread
From: Sam Ravnborg @ 2007-10-20  5:36 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-kernel

On Fri, Oct 19, 2007 at 09:42:24PM -0700, David Brownell wrote:
> This removes a BASH syntax error (seen building on Ubuntu Feisty).
> 
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> 
> --- g26.orig/Makefile	2007-10-19 21:29:43.000000000 -0700
> +++ g26/Makefile	2007-10-19 18:35:32.000000000 -0700
> @@ -1507,7 +1507,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm
>  # and we build for the host arch
>  quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
>        cmd_depmod = \
> -	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" == "$(ARCH)" ]; then \
> +	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" = "$(ARCH)" ]; then \
>  		$(DEPMOD) -ae -F System.map                                     \
>  		$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r)   \
>  		$(KERNELRELEASE);                                               \
> -


Took a look at 'man bash' here.
bash --version
GNU bash, version 3.2.9(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

Accoding to man bash "==" is used to test for equality and "=" is used for assignmnet.
I assume the above is a dash syntax error (dash is default on ubuntu IIRC).

Is it truly protable with "=" or do we need to be more clever?

	Sam

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

* Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix
  2007-10-20  5:36 ` Sam Ravnborg
@ 2007-10-20  5:44   ` Roland Dreier
  2007-10-20  5:52   ` David Brownell
  1 sibling, 0 replies; 5+ messages in thread
From: Roland Dreier @ 2007-10-20  5:44 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: David Brownell, linux-kernel

 > Accoding to man bash "==" is used to test for equality and "=" is used for assignmnet.
 > I assume the above is a dash syntax error (dash is default on ubuntu IIRC).

My bash man page says the following under "CONDITIONAL EXPRESSIONS":

       string1 == string2
              True if the strings are equal.  = may be used in place
              of == for strict POSIX compliance.

This is bash 3.1 as packaged by Debian.

So I think "=" is the correct thing to use for compatibility with dash
or other non-bash shells, since as far as I know, there are no
situations where a comparison with "=" will fail but "==" will succed.
(ie "=" is strictly more compatible).

 - R.

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

* Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix
  2007-10-20  5:36 ` Sam Ravnborg
  2007-10-20  5:44   ` Roland Dreier
@ 2007-10-20  5:52   ` David Brownell
  2007-10-20 13:06     ` Sam Ravnborg
  1 sibling, 1 reply; 5+ messages in thread
From: David Brownell @ 2007-10-20  5:52 UTC (permalink / raw)
  To: sam; +Cc: linux-kernel

> > -	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" == "$(ARCH)" ]; then \
> > +	if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" = "$(ARCH)" ]; then \
>
> Took a look at 'man bash' here.
> bash --version
> GNU bash, version 3.2.9(1)-release (x86_64-redhat-linux-gnu)
> Copyright (C) 2005 Free Software Foundation, Inc.
>
> Accoding to man bash "==" is used to test for equality and "=" is used for assignmnet.

"man test" shows that only "=" works ... that's for string equality,
which is what's being tested there.  And "==" is undefined (error).

If "==" were to kick in that would be for an arithmetic expression;
but "[" is (modulo wierdness) "test" not "expr".


> I assume the above is a dash syntax error (dash is default on ubuntu IIRC).

My $SHELL is /bin/bash:

$ bash --version
GNU bash, version 3.2.13(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
$


> Is it truly protable with "=" or do we need to be more clever?

I don't know how you managed to get it to work wtih "==".
String equality should be "=" in all /bin/sh versions.
It's been that way since it was written in pseudo-Algol.

- Dave


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

* Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix
  2007-10-20  5:52   ` David Brownell
@ 2007-10-20 13:06     ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2007-10-20 13:06 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-kernel

> 
> > Is it truly protable with "=" or do we need to be more clever?
> 
> I don't know how you managed to get it to work wtih "==".
> String equality should be "=" in all /bin/sh versions.
> It's been that way since it was written in pseudo-Algol.

[sam@neptun kbuild.git]$ if [ "x86_64" == "x86_64" ]; then echo foo; else echo bar; fi
foo
[sam@neptun kbuild.git]$ if [ "x86_64" == "x86_64x" ]; then echo foo; else echo bar; fi
bar

So it works as I expected here.

I will push your fix later today (which I have tested and it works here too).

	Sam

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

end of thread, other threads:[~2007-10-20 13:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-20  4:42 [patch 2.6.23-git] toplevel Makefile/depmod bugfix David Brownell
2007-10-20  5:36 ` Sam Ravnborg
2007-10-20  5:44   ` Roland Dreier
2007-10-20  5:52   ` David Brownell
2007-10-20 13:06     ` Sam Ravnborg

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