diff options
author | Eric Blake <eblake@redhat.com> | 2010-02-22 08:46:42 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-02-22 16:01:02 -0700 |
commit | 5990ad9e6ab590626a42764bf21dba6d7a05f237 (patch) | |
tree | a8d72463854180d0c2be350172e8152a5649050e /build-aux/bootstrap | |
parent | aff170b49eab9693cdeaf5cc3559f5c64bfdf4c9 (diff) | |
download | gnulib-5990ad9e6ab590626a42764bf21dba6d7a05f237.tar.gz |
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 <eblake@redhat.com>
Diffstat (limited to 'build-aux/bootstrap')
-rwxr-xr-x | build-aux/bootstrap | 10 |
1 files changed, 3 insertions, 7 deletions
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 ;; |