bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] bootstrap: honor --no-git


From: Eric Blake
Subject: [PATCH] bootstrap: honor --no-git
Date: Wed, 3 Jul 2013 14:02:07 -0600

Based on a report by Chandrashekar Shastri, at
https://bugzilla.redhat.com/show_bug.cgi?id=979360

Basically, 'GNULIB_SRCDIR=... ./bootstrap --no-git' assumes that
GNULIB_SRCDIR is already complete, and NO git actions should be
directly performed (indirect actions, such as autopoint using
git under the hood, are a different matter).  The intent is to
run gnulib-tool directly from the source directory, without
bothering with submodules or updating git via a network.

* build-aux/bootstrap: Don't even try to use git when user is
pointing to a static checkout.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog           |  6 ++++++
 build-aux/bootstrap | 15 +++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5898ff0..0ae4f53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-03  Eric Blake  <address@hidden>
+
+       bootstrap: honor --no-git
+       * build-aux/bootstrap: Don't even try to use git when user is
+       pointing to a static checkout.
+
 2013-06-23  Paul Eggert  <address@hidden>

        ignore-value: port to gcc -pedantic
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 0cbea66..80b7d20 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.19; # 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,16 @@ 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.

 case ${GNULIB_SRCDIR--} in
 -)
+  # Remember 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 +604,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
-- 
1.8.1.4




reply via email to

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