view build-aux/gnulib-bootstrap-git-fetch.diff @ 33261:ab68bff7b8b8

style fixes for panic_ functions * panic.h (panic_impossible, panic_if, panic_unless): If NDEBUG is defined, define away using "do { } while (0)" so that a semicolon is always required. Also allow panic_impossible to be defined away if NDEBUG is defined. * lo-error.h (liboctave_panic_impossible, liboctave_panic_if, liboctave_panic_unless): Likewise.
author John W. Eaton <jwe@octave.org>
date Thu, 28 Mar 2024 00:32:26 -0400
parents e6d339b9309d
children
line wrap: on
line source

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

--- ./bootstrap-funclib.sh.orig	2023-11-20 18:29:45.640064746 +0100
+++ ./bootstrap-funclib.sh	2023-11-20 18:35:57.451241555 +0100
@@ -534,6 +534,11 @@
         fi
 
         trap - HUP INT PIPE TERM
+
+      elif test -n "$GNULIB_REVISION" \
+           && ! git --git-dir="$gnulib_path"/.git cat-file \
+                commit "$GNULIB_REVISION"; then
+        git --git-dir="$gnulib_path"/.git fetch
       fi
     fi
     GNULIB_SRCDIR=$gnulib_path
@@ -546,6 +551,10 @@
   # XXX Should this be done if $use_git is false?
   if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
      && ! git_modules_config submodule.gnulib.url >/dev/null; then
+    if ! git --git-dir="$GNULIB_SRCDIR"/.git cat-file \
+         commit "$GNULIB_REVISION"; then
+      git --git-dir="$GNULIB_SRCDIR"/.git fetch
+    fi
     (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
   fi