Subject: bug#67268: closed (Re: [bug#67268] [PATCH] texinfo: add pointer about combining tests)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 10 Dec 2023 17:52:03 +0000

Your bug report

#67268: [PATCH] texinfo: add pointer about combining tests

which was filed against the automake-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
67268: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67268
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#67268] [PATCH] texinfo: add pointer about combining tests
From: Karl Berry <[email-masked]>
To: [email-masked]
Date: Sun, 10 Dec 2023 10:51:37 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

I guess I don't see any harm in keeping the link to POSIX. Perhaps it
should be in the Autoconf manual, but either way seems ok to me. Since
the OP went to the trouble of looking it up. --best, karl.

Subject: Re: [PATCH] texinfo: add pointer about combining tests
From: Karl Berry <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sat, 18 Nov 2023 19:27:38 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Michael,

    Date: Sun, 16 Oct 2016 18:35:53 +0200
    From: Michael Stapelberg <[email-masked]>
    To: [email-masked]
    Subject: [PATCH] texinfo: add pointer about combining tests

    https://lists.gnu.org/archive/html/automake-patches/2016-10/msg00002.html

Seven years late(r), but I did finally merge (a version of) your
suggestion of a portability note in the Automake manual about &&
vs. test -a, as below.  Thanks! --karl

doc: mention shell operators preferred over `test` options.

* doc/automake.texi (Usage of Conditionals): mention that shell
operators (&&, ||, ()) are preferred over `test` options (-a, -o,
\(\)). Idea and POSIX url reference from Michael Stapelberg,
https://lists.gnu.org/archive/html/automake-patches/2016-10/msg00002.html
diff --git a/doc/automake.texi b/doc/automake.texi
index 51a3c3dbe..635bdd28c 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -11118,6 +11118,14 @@ must arrange for @emph{every} @code{AM_CONDITIONAL} to be invoked every
 time @command{configure} is run.  If @code{AM_CONDITIONAL} is run
 conditionally (e.g., in a shell @code{if} statement), then the result
 will confuse @command{automake}.
+
+For portability, it is best to use shell operators @code{&&} and
+@code{||} and parentheses, when constructing a compound
+@var{condition} using the @command{test} command, and not the
+@code{-a} and @code{-o} options and parentheses as options to
+@command{test}, all of which have been marked obsolescent by POSIX
+(@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_161}).
+The name @code{test} is also more portable than @code{[}.
 @end defmac

 @cindex @option{--enable-debug}, example

compile finished at Sat Nov 18 18:25:16 2023