Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/ci/scripts/checkout-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ fi
function fetch_github_commit_archive {
local module=$1
local cached="download-${module//\//-}.tar.gz"
retry sh -c "rm -f $cached && \
curl -f -sSL -o $cached $2"
rm -f "${cached}"
rm -rf "${module}"
curl -f -sSL -o "${cached}" "$2"
mkdir $module
touch "$module/.git"
# On Windows, the default behavior is to emulate symlinks by copying
# files. However, that ends up being order-dependent while extracting,
# which can cause a failure if the symlink comes first. This env var
# causes tar to use real symlinks instead, which are allowed to dangle.
export MSYS=winsymlinks:nativestrict
mkdir -p "${module}"
tar -C $module --strip-components=1 -xf $cached
rm $cached
}
Expand All @@ -50,7 +52,7 @@ for i in ${!modules[@]}; do
git rm $module
url=${urls[$i]}
url=${url/\.git/}
fetch_github_commit_archive $module "$url/archive/$commit.tar.gz" &
retry fetch_github_commit_archive $module "$url/archive/$commit.tar.gz" &
bg_pids[${i}]=$!
continue
else
Expand Down