X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fbootstrap;h=365a3d92eae8aa7d795ca997ca04146c94102bc2;hb=b39ad3299f70a8267e3dd979e7a2d22abcbe16ab;hp=bd23856193df05cd11953297e882d3dcba45270a;hpb=06e606ded42cacc1bd5397e69f51d9a8aee80928;p=gnulib.git diff --git a/build-aux/bootstrap b/build-aux/bootstrap index bd2385619..365a3d92e 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -1,4 +1,6 @@ #! /bin/sh +# Print a version string. +scriptversion=2010-02-24.17; # UTC # Bootstrap this package from checked-out sources. @@ -431,12 +433,28 @@ case ${GNULIB_SRCDIR--} in GNULIB_SRCDIR=$gnulib_path ;; *) - # Use GNULIB_SRCDIR as a reference. Assumes git 1.6.4 or newer. + # Use GNULIB_SRCDIR as a reference. if test -d "$GNULIB_SRCDIR"/.git && \ git_modules_config submodule.gnulib.url >/dev/null; then echo "$0: getting gnulib files..." - git submodule update --init --reference "$GNULIB_SRCDIR" \ + if git submodule --help|grep reference > /dev/null; then + # Prefer the one-liner available in git 1.6.4 or newer. + git submodule update --init --reference "$GNULIB_SRCDIR" \ "$gnulib_path" || exit $? + else + # This fallback allows at least git 1.5.5. + if test -f "$gnulib_path"/gnulib-tool; then + # Since file already exists, assume submodule init already complete. + git submodule update || exit $? + else + # Older git can't clone into an empty directory. + rmdir "$gnulib_path" 2>/dev/null + git clone --reference "$GNULIB_SRCDIR" \ + "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \ + && git submodule init && git submodule update \ + || exit $? + fi + fi GNULIB_SRCDIR=$gnulib_path fi ;; @@ -825,3 +843,11 @@ fi bootstrap_epilogue echo "$0: done. Now you can run './configure'." + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: