GNU bug report logs -
#67268
[PATCH] texinfo: add pointer about combining tests
Previous Next
Reported by: Karl Berry <karl <at> freefriends.org>
Date: Sun, 19 Nov 2023 02:28:02 UTC
Severity: normal
Tags: patch
Done: Karl Berry <karl <at> freefriends.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67268 in the body.
You can then email your comments to 67268 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
automake-patches <at> gnu.org
:
bug#67268
; Package
automake-patches
.
(Sun, 19 Nov 2023 02:28:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Karl Berry <karl <at> freefriends.org>
:
New bug report received and forwarded. Copy sent to
automake-patches <at> gnu.org
.
(Sun, 19 Nov 2023 02:28:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi Michael,
Date: Sun, 16 Oct 2016 18:35:53 +0200
From: Michael Stapelberg <michael <at> i3wm.org>
To: automake-patches <at> gnu.org
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
Reply sent
to
Karl Berry <karl <at> freefriends.org>
:
You have taken responsibility.
(Sat, 25 Nov 2023 21:37:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Karl Berry <karl <at> freefriends.org>
:
bug acknowledged by developer.
(Sat, 25 Nov 2023 21:37:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 67268-done <at> debbugs.gnu.org (full text, mbox):
Did not alter fixed versions and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 02 Dec 2023 09:37:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
automake-patches <at> gnu.org
:
bug#67268
; Package
automake-patches
.
(Sat, 02 Dec 2023 09:41:01 GMT)
Full text and
rfc822 format available.
Message #15 received at 67268 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 18 Nov 2023 19:27, Karl Berry wrote:
> Hi Michael,
>
>
> Date: Sun, 16 Oct 2016 18:35:53 +0200
> From: Michael Stapelberg <michael <at> i3wm.org>
> To: automake-patches <at> gnu.org
> 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.
is the automake manual the best place for this ? the autoconf manual has a
very extensive "Portable Shell Programming" chapter:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/html_node/Portable-Shell.html
seems like it'd be better to extend that section and link it from here.
-mike
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
automake-patches <at> gnu.org
:
bug#67268
; Package
automake-patches
.
(Sat, 02 Dec 2023 22:10:01 GMT)
Full text and
rfc822 format available.
Message #18 received at 67268 <at> debbugs.gnu.org (full text, mbox):
very extensive "Portable Shell Programming" chapter:
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/html_node/Portable-Shell.html
I know. The Autoconf manual already describes this issue in detail.
The point of the brief mention in the Automake manual is because it is
precisely the place and the problem that are rather likely to come up
in practice.
I see I failed to link to the Autoconf node, though. I'll add that. -k
Information forwarded
to
automake-patches <at> gnu.org
:
bug#67268
; Package
automake-patches
.
(Sun, 03 Dec 2023 01:36:02 GMT)
Full text and
rfc822 format available.
Message #21 received at 67268 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 02 Dec 2023 15:09, Karl Berry wrote:
> very extensive "Portable Shell Programming" chapter:
> https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/html_node/Portable-Shell.html
>
> I know. The Autoconf manual already describes this issue in detail.
> The point of the brief mention in the Automake manual is because it is
> precisely the place and the problem that are rather likely to come up
> in practice.
>
> I see I failed to link to the Autoconf node, though. I'll add that. -k
breadcrumbs in the automake manual is ok before tossing them to autoconf, but i
would make it more brief than we have now. like drop references to the POSIX
state and just leave it as discouraged in favor of the macros for portability.
-mike
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
automake-patches <at> gnu.org
:
bug#67268
; Package
automake-patches
.
(Sun, 10 Dec 2023 17:52:02 GMT)
Full text and
rfc822 format available.
Message #24 received at 67268 <at> debbugs.gnu.org (full text, mbox):
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.
Reply sent
to
Karl Berry <karl <at> freefriends.org>
:
You have taken responsibility.
(Sun, 10 Dec 2023 17:52:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Karl Berry <karl <at> freefriends.org>
:
bug acknowledged by developer.
(Sun, 10 Dec 2023 17:52:03 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 08 Jan 2024 12:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 124 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.