forked from mirrors/nixpkgs
Fix nix-prefetch-git
The nix-prefect git script was broken when trying to parse certain groups of submodules. This patch fixes the url detection for submodule repositories to use the more reliable `git config` commands.
This commit is contained in:
parent
e9963296b1
commit
49b36a3a77
|
@ -142,10 +142,12 @@ init_submodules(){
|
||||||
git submodule status |
|
git submodule status |
|
||||||
while read l; do
|
while read l; do
|
||||||
# checkout each submodule
|
# checkout each submodule
|
||||||
local hash=$(echo $l | sed 's,^-\([0-9a-f]*\) \(.*\)$,\1,');
|
local hash=$(echo $l | awk '{print substr($1,2)}');
|
||||||
local dir=$(echo $l | sed 's,^-\([0-9a-f]*\) \(.*\)$,\2,');
|
local dir=$(echo $l | awk '{print $2}');
|
||||||
local url=$(sed -n "\,$dir, { :loop; n; s,^.*url = ,,; T loop; p; q }" .git/config);
|
local name=$(
|
||||||
|
git config -f .gitmodules --get-regexp submodule\.[^.]*\.path |
|
||||||
|
sed -n "s,^\(.*\)\.path $dir\$,\\1,p")
|
||||||
|
local url=$(git config -f .gitmodules --get ${name}.url);
|
||||||
clone "$dir" "$url" "$hash" "";
|
clone "$dir" "$url" "$hash" "";
|
||||||
done;
|
done;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue