Ralf Wildenhues <[EMAIL PROTECTED]> wrote:
..
> | 2007-10-28  Jim Meyering  <[EMAIL PROTECTED]>
> [...]
> |         * tests/Makefile.am ($(srcdir)/package.m4): Depend on Makefile,
> |         not configure.ac, now that the version number changes automatically.
>
> Yuck, that's ugly.  Should we have a VERSION file, changed by a commit
> hook or something like that?

Hi Benoit and Ralf,

A non-version-controlled file that's updated upon every commit?
Maybe.  Or have configure generate this VERSION file.

...
> If I use a subshell for redirection, the shell exits nonzero:
>
> $ touch a && chmod -w a
> $ sh -c '{ echo foo; } > a'; echo $?
> sh: a: Permission denied
> 0
> $ sh -c '( echo foo; ) > a'; echo $?
> sh: a: Permission denied
> 1
>
> This is bash 3.1.17(1), but also happens with 3.2.0(2); not with pdksh.
> Isn't that a bash bug?

Ouch.  I haven't looked at the spec yet, but I sure don't
like that behavior.  zsh-4.3.4 works the way I would expect:

    $ zsh -c '{ echo foo; } > a'; echo $?
    zsh: permission denied: a
    1

> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index 4c3ad1a..dc1b827 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -35,14 +35,14 @@ include ../lib/freeze.mk
>  ## ------------ ##
>
>  $(srcdir)/package.m4: Makefile
> -     {                                       \
> +     (                                       \
>         echo '# Signature of the current package.'; \
>         echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])'; \
>         echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'; \
>         echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'; \
>         echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])'; \
>         echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
> -     } >$(srcdir)/package.m4
> +     ) >$(srcdir)/package.m4

That looks fine.
It's a shame to pessimize the code, making everyone incur the subshell
cost, to work around such a bug (assuming it is one).
It'd be nice if there were a way to require a working shell.

In the mean time, if you haven't committed it yet, would you please add
a comment so we'll know why it's using a seemingly unnecessary subshell.


_______________________________________________
Autoconf mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to