octave-maintainers
[Top][All Lists]
Advanced

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

Re: bootstrap: improve gnulib git update logic


From: Markus Mützel
Subject: Re: bootstrap: improve gnulib git update logic
Date: Wed, 2 Sep 2020 11:05:20 +0200

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




reply via email to

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