changeset 33477:3362e398d702 default tip @

Update to gnulib revision 92d80242ad1344b5364ca9bd1d995d68c3a73ef7. * bootstrap-funclib.sh: Update from gnulib. * bootstrap.conf: Update GNULIB_REVISION and remove comments about local changes to bootstrap-funclib.sh. * build-aux/gnulib-bootstrap-git-fetch.diff: Delete patch that is no longer needed.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 28 Apr 2024 12:03:16 +0200
parents 0fbf06e4b460
children
files bootstrap-funclib.sh bootstrap.conf build-aux/gnulib-bootstrap-git-fetch.diff
diffstat 3 files changed, 25 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/bootstrap-funclib.sh	Sat Apr 27 17:33:00 2024 +0200
+++ b/bootstrap-funclib.sh	Sun Apr 28 12:03:16 2024 +0200
@@ -1,6 +1,6 @@
 # A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
 
-scriptlibversion=2024-04-13.15; # UTC
+scriptlibversion=2024-04-28.09; # UTC
 
 # Copyright (C) 2003-2024 Free Software Foundation, Inc.
 #
@@ -462,7 +462,17 @@
       || die "Error: --gnulib-srcdir or \$GNULIB_SRCDIR is specified," \
              "but does not contain gnulib-tool"
     if test -n "$GNULIB_REVISION" && $use_git; then
-      (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || exit $?
+      # The 'git checkout "$GNULIB_REVISION"' command succeeds if the
+      # GNULIB_REVISION is a commit hash that exists locally, or if it is
+      # branch name that can be fetched from origin. It fails, however,
+      # if the GNULIB_REVISION is a commit hash that only exists in
+      # origin. In this case, we need a 'git fetch' and then retry
+      # 'git checkout "$GNULIB_REVISION"'.
+      (cd "$GNULIB_SRCDIR" \
+       && { git checkout "$GNULIB_REVISION" 2>/dev/null \
+            || { git fetch origin && git checkout "$GNULIB_REVISION"; }
+          }
+      ) || exit $?
     fi
   else
     if ! $use_git; then
@@ -532,11 +542,17 @@
         # The subdirectory 'gnulib' already exists.
         if test -n "$GNULIB_REVISION"; then
           if test -d "$gnulib_path/.git"; then
-            if ! git --git-dir="$gnulib_path"/.git cat-file \
-                 commit "$GNULIB_REVISION"; then
-              git --git-dir="$gnulib_path"/.git fetch
-            fi
-            (cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || exit 1
+            # The 'git checkout "$GNULIB_REVISION"' command succeeds if the
+            # GNULIB_REVISION is a commit hash that exists locally, or if it is
+            # branch name that can be fetched from origin. It fails, however,
+            # if the GNULIB_REVISION is a commit hash that only exists in
+            # origin. In this case, we need a 'git fetch' and then retry
+            # 'git checkout "$GNULIB_REVISION"'.
+            (cd "$gnulib_path" \
+             && { git checkout "$GNULIB_REVISION" 2>/dev/null \
+                  || { git fetch origin && git checkout "$GNULIB_REVISION"; }
+                }
+            ) || exit $?
           else
             die "Error: GNULIB_REVISION is specified in bootstrap.conf," \
                 "but '$gnulib_path' contains no git history"
--- a/bootstrap.conf	Sat Apr 27 17:33:00 2024 +0200
+++ b/bootstrap.conf	Sun Apr 28 12:03:16 2024 +0200
@@ -200,19 +200,11 @@
 #
 #   ./bootstrap --bootstrap-sync
 #
-# to update the ./bootstrap file from the selected gnulib revision,
-# followed by
-#
-#   patch -p1 -u < ./build-aux/gnulib-bootstrap-git-fetch.diff
-#
-# to apply local changes from build-aux/gnulib-bootstrap-git-fetch.diff
-#
-# The patch is needed to automatically update gnulib repos that have not
-# been updated to contain $GNULIB_REVISION.
+# to update the ./bootstrap file from the selected gnulib revision.
 #
 # See also: https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00150.html
 
-: ${GNULIB_REVISION=92cdf62b56462b914193c7770440e505a37c2526}
+: ${GNULIB_REVISION=92d80242ad1344b5364ca9bd1d995d68c3a73ef7}
 
 # Don't check for translations since we don't have any in Octave yet.
 # This avoids the need for sha1sum or compatible utility in bootstrap.
--- a/build-aux/gnulib-bootstrap-git-fetch.diff	Sat Apr 27 17:33:00 2024 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-Update bootstrap script from upstream gnulib to automatically fetch from repository if needed
-
-See also: https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00150.html
-
-diff -r c51b07a71421 bootstrap-funclib.sh
---- a/bootstrap-funclib.sh	Fri Apr 26 13:33:37 2024 -0400
-+++ b/bootstrap-funclib.sh	Fri Apr 26 20:00:21 2024 +0200
-@@ -532,6 +532,10 @@
-         # The subdirectory 'gnulib' already exists.
-         if test -n "$GNULIB_REVISION"; then
-           if test -d "$gnulib_path/.git"; then
-+            if ! git --git-dir="$gnulib_path"/.git cat-file \
-+                 commit "$GNULIB_REVISION"; then
-+              git --git-dir="$gnulib_path"/.git fetch
-+            fi
-             (cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || exit 1
-           else
-             die "Error: GNULIB_REVISION is specified in bootstrap.conf," \