summaryrefslogtreecommitdiff
path: root/build-aux/bootstrap
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2013-07-03 13:48:58 -0600
committerEric Blake <eblake@redhat.com>2013-07-03 14:08:46 -0600
commitb72ff2a45efde544c406804186d37a3254728571 (patch)
tree53ccfc659e1901bece22319378e96c64380de68f /build-aux/bootstrap
parentf40e61ea0c4940b027aade7dd48948aa93f133a4 (diff)
downloadgnulib-b72ff2a45efde544c406804186d37a3254728571.tar.gz
bootstrap: honor --no-git
Based on a report by Chandrashekar Shastri, at https://bugzilla.redhat.com/show_bug.cgi?id=979360 The intent behind the original addition of --no-git in commit 824f8d16 was to allow builds on a machine that either has no git, or where git is prevented from using the network; yet where the user had other means of checking out the correct version of gnulib (such as using an NFS share). But in practice, we were still trying to use git, in spite of being told where gnulib-tool already lives. This fixes bootstrap to match the original intent, by avoiding all direct use of git or submodules (any indirect use of git, such as by autopoint, is beyond our control; but at least that use does not require network access). It is still up to the end user to ensure that GNULIB_SRCDIR points to the intended gnulib commit. * build-aux/bootstrap: Don't even try to use git when user is pointing to a static checkout. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'build-aux/bootstrap')
-rwxr-xr-xbuild-aux/bootstrap21
1 files changed, 14 insertions, 7 deletions
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 0cbea66e8f..9c522049f0 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2013-05-08.20; # UTC
+scriptversion=2013-07-03.20; # UTC
# Bootstrap this package from checked-out sources.
@@ -551,7 +551,7 @@ fi
echo "$0: Bootstrapping from checked-out $package sources..."
# See if we can use gnulib's git-merge-changelog merge driver.
-if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
+if $use_git && test -d .git && (git --version) >/dev/null 2>/dev/null ; then
if git config merge.merge-changelog.driver >/dev/null ; then
:
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
@@ -574,13 +574,17 @@ git_modules_config () {
test -f .gitmodules && git config --file .gitmodules "$@"
}
-gnulib_path=$(git_modules_config submodule.gnulib.path)
-test -z "$gnulib_path" && gnulib_path=gnulib
+if $use_git; then
+ gnulib_path=$(git_modules_config submodule.gnulib.path)
+ test -z "$gnulib_path" && gnulib_path=gnulib
+fi
-# Get gnulib files.
+# Get gnulib files. Populate $GNULIB_SRCDIR, possibly updating a
+# submodule, for use in the rest of the script.
case ${GNULIB_SRCDIR--} in
-)
+ # Note that $use_git is necessarily true in this case.
if git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
git submodule init || exit $?
@@ -601,8 +605,8 @@ case ${GNULIB_SRCDIR--} in
GNULIB_SRCDIR=$gnulib_path
;;
*)
- # Use GNULIB_SRCDIR as a reference.
- if test -d "$GNULIB_SRCDIR"/.git && \
+ # Use GNULIB_SRCDIR directly or as a reference.
+ if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
if git submodule -h|grep -- --reference > /dev/null; then
@@ -628,6 +632,9 @@ case ${GNULIB_SRCDIR--} in
;;
esac
+# $GNULIB_SRCDIR now points to the version of gnulib to use, and
+# we no longer need to use git or $gnulib_path below here.
+
if $bootstrap_sync; then
cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
echo "$0: updating bootstrap and restarting..."