[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: _AC_CACHE_DUMP simplified
From: |
Ralf Wildenhues |
Subject: |
Re: _AC_CACHE_DUMP simplified |
Date: |
Tue, 4 Apr 2006 23:56:43 +0200 |
User-agent: |
Mutt/1.5.9i |
Hello Eric, Stepan,
* Eric Blake wrote on Wed, Mar 22, 2006 at 05:15:00AM CET:
> According to Stepan Kasal on 3/21/2006 4:26 PM:
>
> > + case `(ac_space=' '; set | grep '^ac_space') 2>&1` in
> > + ac_space=\ *)
>
> grep does not work on the output of set in all shells:
> $ zsh -c "(ac_space=' '; (set) 2>&1 | grep '^ac_space=')"
> Binary file (standard input) matches
> $ zsh -c "(ac_space=' '; (set) 2>&1 | sed -n '/^ac_space=/p')"
> ac_space=' '
So let's fix that right.
The assumption for the validity of the proposed patch below is: for
Ultrix, the output of the second `set' was not discarded on purpose.
Unfortunately, the discussion for this predates public mailing list
archives. But I have strong indication that it's right: the comment
above the macro does not explicitly say so, and the second `set' was
added only after the still-final version of the comment. Thanks David
for consistently using CVS for Autoconf development.
OK to apply?
2006-04-04 Stepan Kasal <address@hidden>,
Eric Blake <address@hidden>,
Ralf Wildenhues <address@hidden>
* lib/autoconf/general.m4 (_AC_CACHE_DUMP): Fix the detection of
whether `set' quotes correctly: redirect stderr of the tested
`set', and use a subshell, for Ultrix; use `sed' instead of
`grep' for zsh `set' which may write binary output; match only
at the beginning of the line, to avoid too many
* doc/autoconf.texi (Shell Substitutions): Document `^' vs. `|'.
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.895
diff -u -r1.895 general.m4
--- lib/autoconf/general.m4 4 Apr 2006 16:13:47 -0000 1.895
+++ lib/autoconf/general.m4 4 Apr 2006 21:29:45 -0000
@@ -1812,8 +1812,8 @@
# and sets the high bit in the cache file unless we assign to the vars.
{
(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case `(ac_space=' '; (set) 2>&1 | sed -n '/^ac_space=/p') 2>&1` in
+ ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
? doc/.autoconf.texi.swp
cvs diff: Diffing doc
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.982
diff -u -r1.982 autoconf.texi
--- doc/autoconf.texi 3 Apr 2006 08:06:22 -0000 1.982
+++ doc/autoconf.texi 4 Apr 2006 21:41:37 -0000
@@ -11007,6 +11007,11 @@
echo $(case x in x) echo hello;; esac)
@end example
address@hidden ^
address@hidden ^ quoting
+Always quote @samp{^}, otherwise traditional shells such as
address@hidden/bin/sh} on Solaris 10 treat this like @samp{|}.
+
@end table
- Re: _AC_CACHE_DUMP simplified,
Ralf Wildenhues <=