mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
fetchgit: fetch submodules in parallel
This commit is contained in:
parent
b7b4da1663
commit
4f72b6af8b
@ -206,27 +206,7 @@ checkout_ref(){
|
|||||||
|
|
||||||
# Update submodules
|
# Update submodules
|
||||||
init_submodules(){
|
init_submodules(){
|
||||||
# Add urls into .git/config file
|
clean_git submodule update --init --recursive -j $NIX_BUILD_CORES
|
||||||
clean_git submodule init
|
|
||||||
|
|
||||||
# list submodule directories and their hashes
|
|
||||||
git submodule status |
|
|
||||||
while read -r l; do
|
|
||||||
local hash
|
|
||||||
local dir
|
|
||||||
local name
|
|
||||||
local url
|
|
||||||
|
|
||||||
# checkout each submodule
|
|
||||||
hash=$(echo "$l" | awk '{print $1}' | tr -d '-')
|
|
||||||
dir=$(echo "$l" | sed -n 's/^.[0-9a-f]\+ \(.*[^)]*\)\( (.*)\)\?$/\1/p')
|
|
||||||
name=$(
|
|
||||||
git config -f .gitmodules --get-regexp submodule\..*\.path |
|
|
||||||
sed -n "s,^\(.*\)\.path $dir\$,\\1,p")
|
|
||||||
url=$(git config --get "${name}.url")
|
|
||||||
|
|
||||||
clone "$dir" "$url" "$hash" ""
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clone(){
|
clone(){
|
||||||
|
Loading…
Reference in New Issue
Block a user