autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.62-22-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.62-22-g3ca7a51
Date: Wed, 14 May 2008 14:29:42 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=3ca7a51d0fa4e6ed467668503bd0246eb5d275c1

The branch, master has been updated
       via  3ca7a51d0fa4e6ed467668503bd0246eb5d275c1 (commit)
      from  809b3e5353f4091e55a8cd918af31309e40b3d1c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3ca7a51d0fa4e6ed467668503bd0246eb5d275c1
Author: Eric Blake <address@hidden>
Date:   Wed May 14 08:25:01 2008 -0600

    Document some FreeBSD shell bugs.
    
    * doc/autoconf.texi (Limitations of Builtins) <!>: Mention ! issue
    in compound pipe commands.
    <export>: Mention difference of exporting an undefined variable.
    (Shell Functions): Mention loss of $? in entry to shell functions.
    Extracted from the git mailing list.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    9 +++++++++
 doc/autoconf.texi |   37 +++++++++++++++++++++++++++++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dc02724..3782a5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-05-14  Eric Blake  <address@hidden>
+
+       Document some FreeBSD shell bugs.
+       * doc/autoconf.texi (Limitations of Builtins) <!>: Mention ! issue
+       in compound pipe commands.
+       <export>: Mention difference of exporting an undefined variable.
+       (Shell Functions): Mention loss of $? in entry to shell functions.
+       Extracted from the git mailing list.
+
 2008-05-13  Stepan Kasal  <address@hidden>
 
        Work around MSYS and Cygwin bugs when dealing with trailing space.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 645cc7b..fd60b7b 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -12297,7 +12297,7 @@ by all shells!
 
 Shell functions are considered portable nowadays, though Autoconf still
 does not use them (Autotest does).  However, some pitfalls have to be
-avoided for portable use of shell functions.
+avoided for portable use of shell functions (@pxref{Shell Functions}).
 
 Some ancient systems have quite
 small limits on the length of the @samp{#!} line; for instance, 32
@@ -13704,6 +13704,19 @@ subshell if the last command of that subshell was 
@code{exit} or
 find a shell that does not exhibit the bug, zsh might be the only shell
 present on the user's machine.
 
+Likewise, the state of @samp{$?} is not reliable when entering a shell
+function.  This has the effect that using a function as the first
+command in a @command{trap} handler can cause problems.
+
address@hidden
+$ @kbd{bash -c 'foo()@{ echo $?; @}; trap foo 0; (exit 2); exit 2'; echo $?}
+2
+2
+$ @kbd{ash -c 'foo()@{ echo $?; @}; trap foo 0; (exit 2); exit 2'; echo $?}
+0
+2
address@hidden example
+
 Shell variables and functions may share the same namespace, for example
 with Solaris 10 @command{/bin/sh}:
 
@@ -13762,6 +13775,16 @@ must use @samp{. ./foo}.
 The Unix version 7 shell did not support
 negating the exit status of commands with @command{!}, and this feature
 is still absent from some shells (e.g., Solaris @command{/bin/sh}).
+Other shells, such as FreeBSD @command{/bin/sh} or @command{ash}, have
+bugs when using @command{!} in compound commands:
+
address@hidden
+$ @kbd{sh -c 'true && ! true | true; echo $?'}
+1
+$ @kbd{ash -c 'true && ! true | true; echo $?'}
+0
address@hidden example
+
 Shell code like this:
 
 @example
@@ -14138,8 +14161,18 @@ alternately @samp{foo} and @samp{bar}, although they 
should print only
 @samp{foo} and then a sequence of @samp{bar}s.
 
 Therefore you should @command{export} again each environment variable
-that you update.
+that you update; the export can occur before or after the assignment.
+
+Posix is not clear on whether the @command{export} of an undefined
+variable causes the variable to be defined with the value of an empty
+string, or merely marks any future definition of a variable by that name
+for export.  Various shells behave differently in this regard:
 
address@hidden
+$ @kbd{sh -c 'export foo; env | grep foo'}
+$ @kbd{ash -c 'export foo; env | grep foo'}
+foo=
address@hidden example
 
 @item @command{false}
 @c ------------------


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

[Prev in Thread] Current Thread [Next in Thread]