From 1e8000fb21c886cfd55fc570a52fed1cf06584b3 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Wed, 27 Mar 2024 11:54:33 +0100 Subject: [PATCH] On the default path, if kernel.org git mirror fails, default to github.com mirror --- linux-tkg-config/prepare | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-tkg-config/prepare b/linux-tkg-config/prepare index e1df22f..cbf185f 100644 --- a/linux-tkg-config/prepare +++ b/linux-tkg-config/prepare @@ -23,6 +23,10 @@ fi if [[ -z "$_git_mirror" ]]; then _git_mirror="${_git_remote_names[2]}" + if $( ! timeout 5 git ls-remote ${_kernel_git_remotes[$_git_mirror]} ) || [[ "$( git ls-remote ${_kernel_git_remotes[$_git_mirror]} )" = *502* ]]; then + warning "kernel.org unreachable or too long to respond" + _git_mirror="${_git_remote_names[0]}" + fi echo "Defaulting to ${_git_mirror} git mirror" fi