Re: bootstrap: improve gnulib git update logic

Markus Mützel <[email protected]>
Newsgroups gmane.comp.gnu.octave.maintainers,gmane.comp.lib.gnulib.bugs
Message-ID <trinity-3a28c1ac-e794-41ce-aa6e-6c0c1d6b8d6d-1599037520760@3c-app-gmx-bs45>
Am 18.08.2020 um 04:09 schrieb "Kai Torben Ohlhus:
> When GNULIB_SRCDIR is set, this addition should probably work as well.
> Looking at it, maybe it can be fixed by extending your code section [2] by "git fetch":
>
>   if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
>      && ! git_modules_config submodule.gnulib.url >/dev/null; then
>     (cd "$GNULIB_SRCDIR" && git fetch && git checkout
> "$GNULIB_REVISION") || cleanup_gnulib
>   fi

I didn't receive the original message. Thanks, Kai, for the pointers.

What about only fetching from the remote repository if the selected revision doesn't exist locally?

diff --git "a/build-aux/bootstrap" "b/build-aux/bootstrap"
index 8f76d6962..6dfbd907d 100644
--- "a/build-aux/bootstrap"
+++ "b/build-aux/bootstrap"
@@ -704,6 +704,8 @@ if $use_gnulib; then

   if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \
      && ! git_modules_config submodule.gnulib.url >/dev/null; then
+    (cd "$GNULIB_SRCDIR" && ! git cat-file commit "$GNULIB_REVISION" \
+     && git fetch)
     (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
   fi


Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.