nix-prefetch-git: fix handling of submodules with spaces
The script would parse the output of `git submodule status` but
didn't handle paths with spaces in them. This would result in the
following error when trying to determine the URL of the submodule:
error: key does not contain a section: .url
commit9fe26eed9ed92ab3899e7aa30f9d40a793af64ed
authorLionello Lunesu <lio+git@lunesu.com>
dateFri 4 May 2018, 07:41 (9 years ago)
parentcc8c33e
pkgs/build-support/fetchgit/nix-prefetch-git+1−1
@@ -185,7 +185,7 @@ init_submodules(){
185185
186186 # checkout each submodule
187187 hash=$(echo "$l" | awk '{print $1}' | tr -d '-')
188− dir=$(echo "$l" | awk '{print $2}')
188+ dir=$(echo "$l" | sed -n 's/^ \{0,1\}[^ ]* \(.*\) ([^ ]*)$/\1/p')
189189 name=$(
190190 git config -f .gitmodules --get-regexp submodule\..*\.path |
191191 sed -n "s,^\(.*\)\.path $dir\$,\\1,p")