From 42229f1040079c959ea47ed4232b008bf1e7b6db Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Thu, 9 Jan 2014 23:11:22 -0600 Subject: [PATCH] nix-prefetch-git: Convert relative submodule URLS to absolute URLS nix-prefetch-git does not convert relative submodule urls into absolute urls based on the parent's origin. This patch adds support for repositories which are using the relative url syntax. --- pkgs/build-support/fetchgit/nix-prefetch-git | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index 0afae009dc57..8d0de055c756 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -148,6 +148,12 @@ init_submodules(){ git config -f .gitmodules --get-regexp submodule\.[^.]*\.path | sed -n "s,^\(.*\)\.path $dir\$,\\1,p") local url=$(git config -f .gitmodules --get ${name}.url); + + # Get Absolute URL if we have a relative URL + if ! echo "$url" | grep '^[a-zA-Z]\+://' >/dev/null 2>&1; then + url="$(git config --get remote.origin.url)/$url" + fi + clone "$dir" "$url" "$hash" ""; done; }