diff options
author | Domen Kožar <domen@dev.si> | 2023-06-21 08:55:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 08:55:21 +0100 |
commit | b51a53644cdd166d682e0bcdfc93ecd5e8004cd4 (patch) | |
tree | 7e7dc91ac7326d4e7b2af7bb7a9a49713c35eb5b /pkgs/build-support | |
parent | 9438752b4f435dd19e3b4db1e95f9f36fbed3ec1 (diff) | |
parent | 4f72b6af8bb66addaeffc0f59c85bb2813d47ff7 (diff) | |
download | nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.tar nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.tar.gz nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.tar.bz2 nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.tar.lz nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.tar.xz nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.tar.zst nixpkgs-b51a53644cdd166d682e0bcdfc93ecd5e8004cd4.zip |
Merge pull request #238733 from domenkozar/fetchgit-submodules-parallel
fetchgit: fetch submodules in parallel
Diffstat (limited to 'pkgs/build-support')
-rwxr-xr-x | pkgs/build-support/fetchgit/nix-prefetch-git | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index ba2dfa2fb2c..e46ccf538bd 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -206,27 +206,7 @@ checkout_ref(){ # Update submodules init_submodules(){ - # Add urls into .git/config file - 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 + clean_git submodule update --init --recursive -j $NIX_BUILD_CORES } clone(){ |