From MAILER-DAEMON Fri Feb 10 02:34:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rvkzr-00021Q-OB
	for mharc-autoconf-commit@gnu.org; Fri, 10 Feb 2012 02:34:19 -0500
Received: from eggs.gnu.org ([140.186.70.92]:60610)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rvkzk-00020o-Le
	for autoconf-commit@gnu.org; Fri, 10 Feb 2012 02:34:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rvkzh-0006Ah-Ca
	for autoconf-commit@gnu.org; Fri, 10 Feb 2012 02:34:12 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:41429)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rvkzh-0006Ad-9l
	for autoconf-commit@gnu.org; Fri, 10 Feb 2012 02:34:09 -0500
Received: from eggert by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rvkzh-00055a-A1
	for autoconf-commit@gnu.org; Fri, 10 Feb 2012 07:34:09 +0000
Date: Fri, 10 Feb 2012 07:34:09 +0000
Message-Id: <E1Rvkzh-00055a-A1@vcs.savannah.gnu.org>
From: "Paul Eggert" <eggert@cs.ucla.edu>
To: autoconf-commit@gnu.org
Subject: [SCM] GNU Autoconf source repository branch, master,
	updated. v2.68-137-ge32b90e
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a1a00a9768e6206feb8ca768d2aa66cdf3408c5c
X-Git-Newrev: e32b90e41f51e607d7974e24f04ecc75e1d75943
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: autoconf-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: autoconf-patches@gnu.org
List-Id: Commits to the Autoconf git repository <autoconf-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf-commit>
List-Post: <mailto:autoconf-commit@gnu.org>
List-Help: <mailto:autoconf-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Feb 2012 07:34:18 -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=e32b90e41f51e607d7974e24f04ecc75e1d75943

The branch, master has been updated
       via  e32b90e41f51e607d7974e24f04ecc75e1d75943 (commit)
      from  a1a00a9768e6206feb8ca768d2aa66cdf3408c5c (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 e32b90e41f51e607d7974e24f04ecc75e1d75943
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Thu Feb 9 23:33:29 2012 -0800

    maint: replace FSF snail-mail addresses with URLs
    
    * tests/erlang.at, tests/go.at, tests/statesave.m4:
    Replace FSF snail mail addresses with URLs, as per GNU coding
    standards, and for consistency with other tests.

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

Summary of changes:
 tests/erlang.at    |    4 +---
 tests/go.at        |    4 +---
 tests/statesave.m4 |    4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/tests/erlang.at b/tests/erlang.at
index a73ad5f..58789b6 100644
--- a/tests/erlang.at
+++ b/tests/erlang.at
@@ -15,9 +15,7 @@ AT_BANNER([Erlang low level compiling and utility macros.])
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 # Since the macros which compile are required by most tests, check
diff --git a/tests/go.at b/tests/go.at
index b45c2b7..8733aee 100644
--- a/tests/go.at
+++ b/tests/go.at
@@ -15,9 +15,7 @@ AT_BANNER([Go low level compiling and utility macros.])
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 # Since the macros which compile are required by most tests, check
diff --git a/tests/statesave.m4 b/tests/statesave.m4
index b28c9ad..2f63ae5 100644
--- a/tests/statesave.m4
+++ b/tests/statesave.m4
@@ -13,9 +13,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # AC_STATE_SAVE(FILE)
 # -------------------


hooks/post-receive
-- 
GNU Autoconf source repository


From MAILER-DAEMON Sat Feb 18 10:49:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RymXb-0001I9-AZ
	for mharc-autoconf-commit@gnu.org; Sat, 18 Feb 2012 10:49:39 -0500
Received: from eggs.gnu.org ([140.186.70.92]:38049)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1RymXY-0001Hy-Gc
	for autoconf-commit@gnu.org; Sat, 18 Feb 2012 10:49:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1RymXX-0005BW-FL
	for autoconf-commit@gnu.org; Sat, 18 Feb 2012 10:49:36 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60037)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1RymXX-0005B7-C9
	for autoconf-commit@gnu.org; Sat, 18 Feb 2012 10:49:35 -0500
Received: from ericb by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1RymXX-0001gm-13
	for autoconf-commit@gnu.org; Sat, 18 Feb 2012 15:49:35 +0000
Date: Sat, 18 Feb 2012 15:49:35 +0000
Message-Id: <E1RymXX-0001gm-13@vcs.savannah.gnu.org>
From: "Eric Blake" <eblake@redhat.com>
To: autoconf-commit@gnu.org
Subject: [SCM] GNU Autoconf source repository branch, master,
	updated. v2.68-138-g989c790
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e32b90e41f51e607d7974e24f04ecc75e1d75943
X-Git-Newrev: 989c790c4f3e24ab68244575bbdf372688e4e8ed
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: autoconf-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: autoconf-patches@gnu.org
List-Id: Commits to the Autoconf git repository <autoconf-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf-commit>
List-Post: <mailto:autoconf-commit@gnu.org>
List-Help: <mailto:autoconf-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Feb 2012 15:49:38 -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=989c790c4f3e24ab68244575bbdf372688e4e8ed

The branch, master has been updated
       via  989c790c4f3e24ab68244575bbdf372688e4e8ed (commit)
      from  e32b90e41f51e607d7974e24f04ecc75e1d75943 (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 989c790c4f3e24ab68244575bbdf372688e4e8ed
Author: Eric Blake <eblake@redhat.com>
Date:   Thu Feb 16 14:29:37 2012 -0700

    docs: tweak 'rm -f' limitations
    
    Based on http://debbugs.gnu.org/10819 and
    http://austingroupbugs.net/view.php?id=542
    
    * doc/autoconf.texi (Limitations of Usual Tools) <rm>: More
    details on 'rm -f' without files.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

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

Summary of changes:
 doc/autoconf.texi |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 82837a2..607d8dc 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -19225,10 +19225,12 @@ This problem no longer exists in Mac OS X 10.4.3.
 @prindex @command{rm}
 The @option{-f} and @option{-r} options are portable.
 
-It is not portable to invoke @command{rm} without operands.  For
-example, on many systems @samp{rm -f -r} (with no other arguments)
-silently succeeds without doing anything, but it fails with a diagnostic
-on NetBSD 2.0.2.
+It is not portable to invoke @command{rm} without options or operands.
+On the other hand, Posix now requires @command{rm -f} to silently
+succeed when there are no operands (useful for constructs like
+@command{rm -rf $filelist} without first checking if @samp{$filelist}
+was empty).  But this was not always portable; at least NetBSD
+@command{rm} built before 2008 would fail with a diagnostic.
 
 A file might not be removed even if its parent directory is writable
 and searchable.  Many Posix hosts cannot remove a mount point, a named


hooks/post-receive
-- 
GNU Autoconf source repository


From MAILER-DAEMON Fri Feb 24 22:53:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S18gx-0000yP-Mu
	for mharc-autoconf-commit@gnu.org; Fri, 24 Feb 2012 22:53:03 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50645)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S18gu-0000xw-Oc
	for autoconf-commit@gnu.org; Fri, 24 Feb 2012 22:53:02 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S18gq-0002yF-4Q
	for autoconf-commit@gnu.org; Fri, 24 Feb 2012 22:53:00 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:38230)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S18gq-0002yB-0m
	for autoconf-commit@gnu.org; Fri, 24 Feb 2012 22:52:56 -0500
Received: from ericb by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S18gp-0007ZQ-Ed
	for autoconf-commit@gnu.org; Sat, 25 Feb 2012 03:52:55 +0000
Date: Sat, 25 Feb 2012 03:52:55 +0000
Message-Id: <E1S18gp-0007ZQ-Ed@vcs.savannah.gnu.org>
From: "Eric Blake" <eblake@redhat.com>
To: autoconf-commit@gnu.org
Subject: [SCM] GNU Autoconf source repository branch, master,
	updated. v2.68-139-gfed83ed
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 989c790c4f3e24ab68244575bbdf372688e4e8ed
X-Git-Newrev: fed83ed994ecc931769de2fa579ab4aec89028bd
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: autoconf-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: autoconf-patches@gnu.org
List-Id: Commits to the Autoconf git repository <autoconf-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf-commit>
List-Post: <mailto:autoconf-commit@gnu.org>
List-Help: <mailto:autoconf-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 25 Feb 2012 03:53:02 -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=fed83ed994ecc931769de2fa579ab4aec89028bd

The branch, master has been updated
       via  fed83ed994ecc931769de2fa579ab4aec89028bd (commit)
      from  989c790c4f3e24ab68244575bbdf372688e4e8ed (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 fed83ed994ecc931769de2fa579ab4aec89028bd
Author: Eric Blake <eblake@redhat.com>
Date:   Fri Feb 24 20:45:35 2012 -0700

    doc: mention more pitfalls of file mode tests
    
    4.3BSD is museum-ware now, so we can assume that test -x exists;
    however, we still can't assume that it always does what we want.
    
    * doc/autoconf.texi (Limitations of Builtins) <test (files)>:
    Treat 'test -x' as mostly portable, but mention problems with
    root user, ACLs, and TOCTTOU races.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

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

Summary of changes:
 doc/autoconf.texi |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 607d8dc..9c75ab0 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -18125,14 +18125,30 @@ It is safe to use @samp{!} as a @command{test} operator.  For example,
 To enable @command{configure} scripts to support cross-compilation, they
 shouldn't do anything that tests features of the build system instead of
 the host system.  But occasionally you may find it necessary to check
-whether some arbitrary file exists.  To do so, use @samp{test -f} or
-@samp{test -r}.  Do not use @samp{test -x}, because 4.3BSD does not
-have it.  Do not use @samp{test -e} either, because Solaris @command{/bin/sh}
+whether some arbitrary file exists.  To do so, use @samp{test -f},
+@samp{test -r}, or @samp{test -x}.  Do not use @samp{test -e}, because
+Solaris 10 @command{/bin/sh}
 lacks it.  To test for symbolic links on systems that have them, use
 @samp{test -h} rather than @samp{test -L}; either form conforms to
 Posix 1003.1-2001, but older shells like Solaris 8
 @code{/bin/sh} support only @option{-h}.
 
+For historical reasons, Posix reluctantly allows implementations of
+@samp{test -x} that will succeed for the root user, even if no execute
+permissions are present.  Furthermore, shells do not all agree on
+whether Access Control Lists should affect @samp{test -r}, @samp{test
+-w}, and @samp{test -x}; some shells base test results strictly on the
+current user id compared to file owner and mode, as if by
+@code{stat(2)}; while other shells base test results on whether the
+current user has the given right, even if that right is only granted by
+an ACL, as if by @code{faccessat(2)}.  Furthermore, there is a classic
+time of check to time of use race between any use of @command{test}
+followed by operating on the just-checked file.  Therefore, it is a good
+idea to write scripts that actually attempt an operation, and are
+prepared for the resulting failure if permission is denied, rather than
+trying to avoid an operation based solely on whether @command{test}
+guessed that it might not be permitted.
+
 @item @command{test} (strings)
 @c ---------------------------
 Posix says that @samp{test "@var{string}"} succeeds if @var{string} is


hooks/post-receive
-- 
GNU Autoconf source repository


From MAILER-DAEMON Mon Feb 27 15:00:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S26kL-0002Um-1B
	for mharc-autoconf-commit@gnu.org; Mon, 27 Feb 2012 15:00:33 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52693)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S26kH-0002TG-Mp
	for autoconf-commit@gnu.org; Mon, 27 Feb 2012 15:00:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S26kF-0007uB-KX
	for autoconf-commit@gnu.org; Mon, 27 Feb 2012 15:00:29 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:39095)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S26kF-0007u7-F5
	for autoconf-commit@gnu.org; Mon, 27 Feb 2012 15:00:27 -0500
Received: from ericb by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S26kE-0004Xx-WB
	for autoconf-commit@gnu.org; Mon, 27 Feb 2012 20:00:27 +0000
Date: Mon, 27 Feb 2012 20:00:27 +0000
Message-Id: <E1S26kE-0004Xx-WB@vcs.savannah.gnu.org>
From: "Eric Blake" <eblake@redhat.com>
To: autoconf-commit@gnu.org
Subject: [SCM] GNU Autoconf source repository branch, master,
	updated. v2.68-142-gff30112
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: fed83ed994ecc931769de2fa579ab4aec89028bd
X-Git-Newrev: ff3011217dc8bf66fc8f355f18436d1b3ab6a575
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: autoconf-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: autoconf-patches@gnu.org
List-Id: Commits to the Autoconf git repository <autoconf-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/autoconf-commit>
List-Post: <mailto:autoconf-commit@gnu.org>
List-Help: <mailto:autoconf-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/autoconf-commit>,
	<mailto:autoconf-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2012 20:00:31 -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=ff3011217dc8bf66fc8f355f18436d1b3ab6a575

The branch, master has been updated
       via  ff3011217dc8bf66fc8f355f18436d1b3ab6a575 (commit)
       via  9e4e0a37d7b7200f671c2eadb3478a77d2dd7c9c (commit)
       via  8798792f568d7cdfb0815d249fe6a718d6877708 (commit)
      from  fed83ed994ecc931769de2fa579ab4aec89028bd (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 ff3011217dc8bf66fc8f355f18436d1b3ab6a575
Author: Eric Blake <eblake@redhat.com>
Date:   Sat Feb 25 07:14:29 2012 -0700

    tests: add test for AS_EXECUTABLE_P
    
    Now that this is public, we should regression test it.
    
    * tests/m4sh.at (AS@&t@_EXECUTABLE): New test.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

commit 9e4e0a37d7b7200f671c2eadb3478a77d2dd7c9c
Author: Eric Blake <eblake@redhat.com>
Date:   Fri Feb 24 21:54:39 2012 -0700

    m4sh: make AS_EXECUTABLE_P public
    
    In the process of making it public, factor it into a reusable
    function.  This makes constructs like AC_CHECK_PROGRAM smaller,
    as well as making libtool's naughty use of $as_executable_p safer.
    
    * lib/m4sugar/m4sh.m4 (_AS_TEST_PREPARE): Add a shell function.
    (AS_EXECUTABLE_P): Forward to shell function.
    * doc/autoconf.texi (Common Shell Constructs): Document it.
    * NEWS: Mention this.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

commit 8798792f568d7cdfb0815d249fe6a718d6877708
Author: Eric Blake <eblake@redhat.com>
Date:   Fri Feb 24 21:09:34 2012 -0700

    m4sh: require that 'test -x' works
    
    4.3BSD is no longer a reasonable portability target; and we are
    pretty sure that these days we can find at least one shell on any
    platform that supports 'test -x'.  Drop a horribly unsafe use of
    eval as a result. :)
    
    Libtool still uses $as_executable_p without so much as calling
    either AS_TEST_X or AS_EXECUTABLE_P; even though the latter has
    existed, although undocumented, since at least 2.59; furthermore,
    libtool uses it in a context where filtering out directories
    would have been desirable.  Shame on them.
    
    * lib/m4sugar/m4sh.m4 (_AS_TEST_X_WORKS): New probe.
    (AS_SHELL_SANITIZE, AS_INIT): Use it in shell searching.
    (AS_TEST_X, AS_EXECUTABLE_P): Simplify.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

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

Summary of changes:
 NEWS                |    2 +
 doc/autoconf.texi   |    7 ++++++
 lib/m4sugar/m4sh.m4 |   55 +++++++++++++++++---------------------------------
 tests/m4sh.at       |   52 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 80 insertions(+), 36 deletions(-)

diff --git a/NEWS b/NEWS
index decad47..1a5f775 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ GNU Autoconf NEWS - User visible changes.
 ** AS_LITERAL_IF again treats '=' as a literal.  Regression introduced in
    2.66.
 
+** The macro AS_EXECUTABLE_P, present since 2.50, is now documented.
+
 ** Macros
 
 - AC_PROG_LN_S and AS_LN_S now fall back on 'cp -pR' (not 'cp -p') if 'ln -s'
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 9c75ab0..83f24ba 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -13658,6 +13658,13 @@ m4_bpatsubst([[@var{string}]], ['], ['\\''])
 @end example
 @end defmac
 
+@defmac AS_EXECUTABLE_P (@var{file})
+@asindex{EXECUTABLE_P}
+Emit code to probe whether @var{file} is a regular file with executable
+permissions (and not a directory with search permissions).  The caller
+is responsible for quoting @var{file}.
+@end defmac
+
 @defmac AS_EXIT (@dvar{status, $?})
 @asindex{EXIT}
 Emit code to exit the shell with @var{status}, defaulting to @samp{$?}.
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 5d01f55..91fc0fb 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -513,6 +513,7 @@ m4_define([AS_SHELL_SANITIZE],
 m4_provide_if([AS_INIT], [],
 [m4_provide([AS_INIT])
 _AS_DETECT_REQUIRED([_AS_SHELL_FN_WORK])
+_AS_DETECT_REQUIRED([_AS_TEST_X_WORKS])
 _AS_DETECT_BETTER_SHELL
 _AS_UNSET_PREPARE
 ])])
@@ -1084,9 +1085,11 @@ fi
 # AS_TEST_X
 # ---------
 # Check whether a file has executable or search permissions.
+# FIXME: This macro is no longer useful; consider deleting it in 2014
+# after we ensure m4sh scripts can always find a shell with test -x.
 m4_defun_init([AS_TEST_X],
 [AS_REQUIRE([_AS_TEST_PREPARE])],
-[$as_test_x $1[]])# AS_TEST_X
+[test -x $1[]])# AS_TEST_X
 
 
 # AS_EXECUTABLE_P
@@ -1094,7 +1097,7 @@ m4_defun_init([AS_TEST_X],
 # Check whether a file is a regular file that has executable permissions.
 m4_defun_init([AS_EXECUTABLE_P],
 [AS_REQUIRE([_AS_TEST_PREPARE])],
-[{ test -f $1 && AS_TEST_X([$1]); }])# AS_EXECUTABLE_P
+[as_fn_executable_p $1])# AS_EXECUTABLE_P
 
 
 # _AS_EXPR_PREPARE
@@ -1365,43 +1368,22 @@ m4_define([AS_SET_CATFILE],
 esac[]])# AS_SET_CATFILE
 
 
+# _AS_TEST_X_WORKS
+# ----------------
+# These days, we require that `test -x' works.
+m4_define([_AS_TEST_X_WORKS], [test -x /])
+
 # _AS_TEST_PREPARE
 # ----------------
-# Find out whether `test -x' works.  If not, prepare a substitute
-# that should work well enough for most scripts.
-#
-# Here are some of the problems with the substitute.
-# The 'ls' tests whether the owner, not the current user, can execute/search.
-# The eval means '*', '?', and '[' cause inadvertent file name globbing
-# after the 'eval', so jam together as many tokens as we can to minimize
-# the likelihood that the inadvertent globbing will actually do anything.
-# Luckily, this gorp is needed only on really ancient hosts.
-#
+# Provide back-compat to people that hooked into our undocumented
+# internals (here's looking at you, libtool).
 m4_defun([_AS_TEST_PREPARE],
-[if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$[]1"; then
-	test -d "$[]1/.";
-      else
-	case $[]1 in @%:@(
-	-*)set "./$[]1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$[]1" 2>/dev/null` in @%:@((
-	???[[sx]]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-dnl as_executable_p is present for backward compatibility with Libtool
-dnl 1.5.22, but it should go away at some point.
-as_executable_p=$as_test_x
+[AS_REQUIRE_SHELL_FN([as_fn_executable_p],
+  [AS_FUNCTION_DESCRIBE([as_fn_executable_p], [FILE],
+    [Test if FILE is an executable regular file.])],
+  [  test -f "$[]1" && test -x "$[]1"])]dnl
+[as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 ])# _AS_TEST_PREPARE
 
 
@@ -2177,5 +2159,6 @@ m4_divert_text([M4SH-INIT-FN], [m4_text_box([M4sh Shell Functions.])])
 m4_divert([BODY])dnl
 m4_text_box([Main body of script.])
 _AS_DETECT_REQUIRED([_AS_SHELL_FN_WORK])dnl
+_AS_DETECT_REQUIRED([_AS_TEST_X_WORKS])dnl
 AS_REQUIRE([_AS_UNSET_PREPARE], [], [M4SH-INIT-FN])dnl
 ])
diff --git a/tests/m4sh.at b/tests/m4sh.at
index e9da403..38667e4 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -552,6 +552,58 @@ AT_CLEANUP
 
 
 
+## ----------------- ##
+## AS_EXECUTABLE_P.  ##
+## ----------------- ##
+
+# Check for executable regular files.
+AT_SETUP([AS@&t@_EXECUTABLE_P])
+AT_KEYWORDS([m4sh])
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+
+if AS_EXECUTABLE_P([/]); then
+  echo fail
+else
+  echo 1
+fi
+cat > foo.sh <<\EOF || AS_EXIT([1])
+#/bin/sh
+exit 0
+EOF
+# File systems like FAT tend to fake executable permissions on all files.
+# At this point, foo.sh should be executable iff permissions are faked.
+AS_EXECUTABLE_P([foo.sh])
+st1=$?
+(./foo.sh) >/dev/null 2>&1
+st2=$?
+case $st1:$st2 in
+  1:126 | 0:0 ) echo 2 ;;
+  *) echo "fail ($st1:$st2)" ;;
+esac
+# Now things better be executable
+chmod a+x foo.sh || AS_EXIT([2])
+mkdir 'two  spaces' || AS_EXIT([3])
+'two  spaces'/../foo.sh || AS_EXIT([4])
+if AS_EXECUTABLE_P(["two  spaces/../foo.sh"]); then
+  echo 3
+else
+  echo fail
+fi
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([$CONFIG_SHELL ./script], [],
+[[1
+2
+3
+]])
+
+AT_CLEANUP
+
+
+
 ## --------- ##
 ## AS_EXIT.  ##
 ## --------- ##


hooks/post-receive
-- 
GNU Autoconf source repository


