From 5990ad9e6ab590626a42764bf21dba6d7a05f237 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 22 Feb 2010 08:46:42 -0700 Subject: [PATCH] bootstrap: use GNULIB_SRCDIR to reduce disk usage This slightly changes the semantics of GNULIB_SRCDIR; previously, it was a way to change the contents of .gitmodules to actually point to a new location, which meant that running: GNULIB_SRCDIR=~/gnulib ./bootstrap would result in a dirty tree. The new semantics are nicer; the submodule is cloned as normal, but the clone uses the original $GNULIB_SRCDIR as an object reference to reduce download time and disk space. * build-aux/bootstrap (GNULIB_SRCDIR): If set, use as a reference, rather than reconfiguring where the submodule points. Signed-off-by: Eric Blake --- ChangeLog | 4 ++++ build-aux/bootstrap | 10 +++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index efba1e7f4b..916b31159c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-02-22 Eric Blake + bootstrap: use GNULIB_SRCDIR to reduce disk usage + * build-aux/bootstrap (GNULIB_SRCDIR): If set, use as a reference, + rather than reconfiguring where the submodule points. + gettimeofday: restore support for platforms that lack function * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Also compile replacement if function is missing. diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 0fb0ac53b4..1595d1b3e0 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -43,7 +43,7 @@ Options: sources reside. Use this if you already have gnulib sources on your machine, and do not want to waste your bandwidth downloading - them again. + them again. Defaults to \$GNULIB_SRCDIR. --copy Copy files instead of creating symbolic links. --force Attempt to bootstrap even if the sources seem not to have been checked out. @@ -421,15 +421,11 @@ case ${GNULIB_SRCDIR--} in GNULIB_SRCDIR=gnulib ;; *) - # Redirect the gnulib submodule to the directory on the command line - # if possible. + # Use GNULIB_SRCDIR as a reference. Assumes git 1.6.4 or newer. if test -d "$GNULIB_SRCDIR"/.git && \ git_modules_config submodule.gnulib.url >/dev/null; then - git submodule init - GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd` - git_modules_config --replace-all submodule.gnulib.url $GNULIB_SRCDIR echo "$0: getting gnulib files..." - git submodule update || exit $? + git submodule update --init --reference "$GNULIB_SRCDIR" gnulib || exit $? GNULIB_SRCDIR=gnulib fi ;; -- 2.30.2