bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] bootstrap: allow non-submodule control of gnulib


From: Colin Watson
Subject: [PATCH] bootstrap: allow non-submodule control of gnulib
Date: Mon, 9 Apr 2018 10:15:29 +0100
User-agent: NeoMutt/20170113 (1.7.2)

Some projects prefer to avoid git submodules for various reasons (they
have rather strange UI), but at present they're the only way to pin a
particular gnulib commit.  Add a couple of extra variables which can be
set in bootstrap.conf to control this separately.

* build-aux/bootstrap: Honour GNULIB_URL and GNULIB_REVISION in
bootstrap.conf when fetching gnulib using "git clone" or via
GNULIB_SRCDIR.

Signed-off-by: Colin Watson <address@hidden>
---
 build-aux/bootstrap | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 92be11439..b5d000370 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -634,9 +634,11 @@ case ${GNULIB_SRCDIR--} in
     trap cleanup_gnulib 1 2 13 15
 
     shallow=
-    git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
-    git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
-      cleanup_gnulib
+    if test -z "$GNULIB_REVISION"; then
+      git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
+    fi
+    git clone $shallow ${GNULIB_URL:-git://git.sv.gnu.org/gnulib} \
+      "$gnulib_path" || cleanup_gnulib
 
     trap - 1 2 13 15
   fi
@@ -671,6 +673,11 @@ case ${GNULIB_SRCDIR--} in
   ;;
 esac
 
+if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" && \
+      ! git_modules_config submodule.gnulib.url >/dev/null; then
+  (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib
+fi
+
 # $GNULIB_SRCDIR now points to the version of gnulib to use, and
 # we no longer need to use git or $gnulib_path below here.
 
-- 
2.15.1



reply via email to

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