[patch 2.6.23-git] toplevel Makefile/depmod bugfix - Kernel

This is a discussion on [patch 2.6.23-git] toplevel Makefile/depmod bugfix - Kernel ; This removes a BASH syntax error (seen building on Ubuntu Feisty). Signed-off-by: David Brownell --- 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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: [patch 2.6.23-git] toplevel Makefile/depmod bugfix

  1. [patch 2.6.23-git] toplevel Makefile/depmod bugfix

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

    Signed-off-by: David Brownell

    --- 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); \
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix

    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
    >
    > --- 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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix

    > 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.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix

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

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [patch 2.6.23-git] toplevel Makefile/depmod bugfix

    >
    > > 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
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread