Update the bootstrap script to be compatible with newer versions
of GIT that changed the git clone -h output from containing:
"--depth"
to:
"--[no-]depth"
Use a regular expression that will support either.
In the future, when GNULIB version is bumped, this bootstrap
change can be replaced by the latest GNULIB bootstrap script
as it appears GNULIB bootstrap now assumes GIT supports the
depth option. This change avoids a full clone on GNULIB, saving
something like 50 MB.

Fixes: https://savannah.gnu.org/bugs/?66357

Signed-off-by: Andrew Hamilton <adham...@gmail.com>
---
 bootstrap | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bootstrap b/bootstrap
index dc2238f4a..be8d3582e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -762,11 +762,11 @@ 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 -h 2>&1 | grep -E -- '--(\[no-\])?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'
+        git fetch -h 2>&1 | grep -E -- '--(\[no-\])?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
-- 
2.47.2


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to