summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2022-03-25 19:08:28 +0000
committerPádraig Brady <P@draigBrady.com>2022-03-25 19:08:28 +0000
commite07c40c3ea77084b9ef8c0a2e10eb62f0175a606 (patch)
tree9fa75c007e9a9ef49e9aaaebe48dfb84a3392eb8
parent500c697cc85b7c1ec6ca4e329331cf3c6fc8f2ab (diff)
downloadcoreutils-e07c40c3ea77084b9ef8c0a2e10eb62f0175a606.tar.gz
maint: sync latest bootstrap from gnulib
* bootstrap: Should have updated this with the last gnulib update.
-rwxr-xr-xbootstrap25
1 files changed, 21 insertions, 4 deletions
diff --git a/bootstrap b/bootstrap
index 96588618b..9c14d24f5 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2021-04-11.09; # UTC
+scriptversion=2022-03-21.01; # UTC
# Bootstrap this package from checked-out sources.
@@ -763,9 +763,26 @@ if $use_gnulib; then
shallow=
if test -z "$GNULIB_REVISION"; then
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
+ git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
+ || cleanup_gnulib
+ else
+ git fetch -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
+ mkdir -p "$gnulib_path"
+ # Only want a shallow checkout of $GNULIB_REVISION, but git does not
+ # support cloning by commit hash. So attempt a shallow fetch by commit
+ # hash to minimize the amount of data downloaded and changes needed to
+ # be processed, which can drastically reduce download and processing
+ # time for checkout. If the fetch by commit fails, a shallow fetch can
+ # not be performed because we do not know what the depth of the commit
+ # is without fetching all commits. So fallback to fetching all commits.
+ git -C "$gnulib_path" init
+ git -C "$gnulib_path" remote add origin \
+ ${GNULIB_URL:-$default_gnulib_url}
+ git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \
+ || git -C "$gnulib_path" fetch origin \
+ || cleanup_gnulib
+ git -C "$gnulib_path" reset --hard FETCH_HEAD
fi
- git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
- || cleanup_gnulib
trap - 1 2 13 15
fi
@@ -1093,7 +1110,7 @@ bootstrap_epilogue
echo "$0: done. Now you can run './configure'."
-# Local variables:
+# Local Variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"