about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorLionello Lunesu <lio+git@lunesu.com>2018-05-04 07:41:06 +0800
committerLionello Lunesu <lio+git@lunesu.com>2018-05-04 23:16:51 +0800
commit9fe26eed9ed92ab3899e7aa30f9d40a793af64ed (patch)
tree7f882809f5ca9db8cb88b10b86e03fc9ab4c07a8 /pkgs/build-support
parentcc8c33e15979976b4f44acb7a7ee54dbde962a32 (diff)
downloadnixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.tar
nixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.tar.gz
nixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.tar.bz2
nixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.tar.lz
nixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.tar.xz
nixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.tar.zst
nixlib-9fe26eed9ed92ab3899e7aa30f9d40a793af64ed.zip
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
Diffstat (limited to 'pkgs/build-support')
-rwxr-xr-xpkgs/build-support/fetchgit/nix-prefetch-git2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git
index 2441da156d1a..1d993dcc1094 100755
--- a/pkgs/build-support/fetchgit/nix-prefetch-git
+++ b/pkgs/build-support/fetchgit/nix-prefetch-git
@@ -185,7 +185,7 @@ init_submodules(){
 
         # checkout each submodule
         hash=$(echo "$l" | awk '{print $1}' | tr -d '-')
-        dir=$(echo "$l" | awk '{print $2}')
+        dir=$(echo "$l" | sed -n 's/^ \{0,1\}[^ ]* \(.*\) ([^ ]*)$/\1/p')
         name=$(
             git config -f .gitmodules --get-regexp submodule\..*\.path |
             sed -n "s,^\(.*\)\.path $dir\$,\\1,p")