]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: allow non-submodule control of gnulib
authorColin Watson <cjwatson@debian.org>
Sun, 27 May 2018 20:07:58 +0000 (22:07 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 27 May 2018 20:07:58 +0000 (22:07 +0200)
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.

ChangeLog
build-aux/bootstrap

index daa6c2b9e47f1bb17f841f2ac252c70bec7ccd9c..26d6414e3252b729eaaf537dd20ba6cc89726285 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-04-09  Colin Watson  <cjwatson@debian.org>
+
+       bootstrap: allow non-submodule control of gnulib
+       * build-aux/bootstrap: Honour GNULIB_URL and GNULIB_REVISION in
+       bootstrap.conf when fetching gnulib using "git clone" or via
+       GNULIB_SRCDIR.
+
 2018-05-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        crypto: omit stream ops Emacs doesn’t need
index eddacfb64d5e632a2ceb970d449f6de7f510b520..747946abdb49239a386cc42e2a4228107c95aae5 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2018-04-28.14; # UTC
+scriptversion=2018-05-27.20; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -634,9 +634,11 @@ if $use_gnulib; then
       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 @@ if $use_gnulib; then
     ;;
   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.