Colin Watson
2018-04-09 09:15:29 UTC
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 <***@debian.org>
---
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.
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 <***@debian.org>
---
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
2.15.1