groff-commit
[Top][All Lists]
Advanced

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

[groff] 30/30: [gdiffmk]: Track revisions to groff Autotoolage.


From: G. Branden Robinson
Subject: [groff] 30/30: [gdiffmk]: Track revisions to groff Autotoolage.
Date: Sun, 22 Dec 2024 19:39:22 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 4992777787e9e376a603d245c1f7cbb58381d8af
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Dec 22 17:19:37 2024 -0600

    [gdiffmk]: Track revisions to groff Autotoolage.
    
    ...prompted by the fact that "test -ef" is now a POSIX-conforming usage.
    
    * gdiffmk.am (gdiffmk): Textually replace Autofoo macro
      `POSIX_SHELL_PROG` instead of `HAVE_TEST_EF_OPTION` and `BASH_PROG`.
    
    * gdiffmk.sh: Migrate shebang line from `BASH_PROG` to
      `POSIX_SHELL_PROG`.
    
      (WouldClobber): Test for `test -ef` functionality ourselves, using
      `POSIX_SHELL_PROG`.  Not only does this reduce a point of contact
      between gdiffmk and groff's Autotoolage, but it accommodates scenarios
      where the build environment has a POSIX-conforming "test -ef" (perhaps
      because GNU Bash was installed and used as the shell), but the
      installation environment does not.
---
 contrib/gdiffmk/ChangeLog  | 18 ++++++++++++++++++
 contrib/gdiffmk/gdiffmk.am |  5 ++---
 contrib/gdiffmk/gdiffmk.sh | 15 ++++++---------
 3 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/contrib/gdiffmk/ChangeLog b/contrib/gdiffmk/ChangeLog
index c7d8fd759..982143ac2 100644
--- a/contrib/gdiffmk/ChangeLog
+++ b/contrib/gdiffmk/ChangeLog
@@ -1,3 +1,21 @@
+2024-12-22  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       Track revisions to groff Autotools usage, prompted by the fact
+       that "test -ef" is now a POSIX-conforming usage.
+
+       * gdiffmk.am (gdiffmk): Textually replace Autofoo macro
+       `POSIX_SHELL_PROG` instead of `HAVE_TEST_EF_OPTION` and
+       `BASH_PROG`.
+       * gdiffmk.sh: Migrate shebang line from `BASH_PROG` to
+       `POSIX_SHELL_PROG`.
+       (WouldClobber): Test for `test -ef` functionality ourselves,
+       using `POSIX_SHELL_PROG`.  Not only does this reduce a point of
+       contact between gdiffmk and groff's Autotoolage, but it
+       accommodates scenarios where the build environment has a
+       POSIX-conforming "test -ef" (perhaps because GNU Bash was
+       installed and used as the shell), but the installation
+       environment does not.
+
 2023-12-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tests/runtests.sh: Test for "diff -D" support as gdiffmk
diff --git a/contrib/gdiffmk/gdiffmk.am b/contrib/gdiffmk/gdiffmk.am
index 12294d4bc..64c2d0c55 100644
--- a/contrib/gdiffmk/gdiffmk.am
+++ b/contrib/gdiffmk/gdiffmk.am
@@ -1,6 +1,6 @@
 # Automake rules for 'gdiffmk' (integration into the groff source tree)
 #
-# Copyright (C) 2004-2023 Free Software Foundation, Inc.
+# Copyright (C) 2004-2024 Free Software Foundation, Inc.
 # Written by Mike Bianchi <MBianchi@Foveal.com>
 # Automake migration by Bertrand Garrigues
 # Changes from May 2015 onward by the groff development team
@@ -46,8 +46,7 @@ EXTRA_DIST += \
 gdiffmk: $(gdiffmk_srcdir)/gdiffmk.sh
        $(AM_V_GEN)sed -e "s|[@]BINDIR[@]|$(bindir)|g" \
            -e "s|[@]VERSION[@]|$(VERSION)|g" \
-           -e "s|[@]HAVE_TEST_EF_OPTION[@]|$(HAVE_TEST_EF_OPTION)|g" \
-           -e "s|[@]BASH_PROG[@]|$(BASH_PROG)|g" \
+           -e "s|[@]POSIX_SHELL_PROG[@]|$(POSIX_SHELL_PROG)|g" \
            -e "s|[@]DIFF_PROG[@]|$(DIFF_PROG)|g" \
            -e $(SH_SCRIPT_SED_CMD)  $(gdiffmk_srcdir)/gdiffmk.sh \
            >$@ \
diff --git a/contrib/gdiffmk/gdiffmk.sh b/contrib/gdiffmk/gdiffmk.sh
index 60dfed6fd..cbc98086d 100644
--- a/contrib/gdiffmk/gdiffmk.sh
+++ b/contrib/gdiffmk/gdiffmk.sh
@@ -1,5 +1,5 @@
-#!@BASH_PROG@
-# Copyright (C) 2004-2023 Free Software Foundation, Inc.
+#!@POSIX_SHELL_PROG@
+# Copyright (C) 2004-2024 Free Software Foundation, Inc.
 # Written by Mike Bianchi <MBianchi@Foveal.com>
 # Changes from May 2015 onward by the groff development team
 
@@ -121,13 +121,12 @@ WouldClobber () {
                ;;
        esac
 
-       # BASH_PROG is set to /bin/sh if bash was not found
-       if test "$HAVE_TEST_EF_OPTION" = "no" \
-               && test "$BASH_PROG" = "/bin/sh"
+       cmd='test /dev/null -ef /dev/null > /dev/null 2>&1'
+       if ! @POSIX_SHELL_PROG@ -c "$cmd"
        then
                Exit 3 \
-               "Your shell does support test -ef, [OUTPUT] can only be the" \
-               "standard  output."
+               "The system's 'test' command does not support the" \
+               " '-ef' option; OUTPUT can be only the standard output."
        else
                if test "$1" -ef "$3"
                then
@@ -167,8 +166,6 @@ RequiresArgument () {
        esac
 }
 
-HAVE_TEST_EF_OPTION=@HAVE_TEST_EF_OPTION@
-BASH_PROG=@BASH_PROG@
 BADOPTION=
 DIFFCMD=@DIFF_PROG@
 SEDCMD=sed



reply via email to

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