Replace fetchgit default builder by a wrapper around nix-prefect-git.

svn path=/nixpkgs/trunk/; revision=28709
This commit is contained in:
Nicolas Pierron
2011-08-20 14:29:57 +00:00
parent 4b3530f55d
commit 9e53a20f50
3 changed files with 115 additions and 74 deletions
+1 -26
View File
@@ -6,31 +6,6 @@ source $stdenv/setup
header "exporting $url (rev $rev) into $out"
git init $out
cd $out
git remote add origin "$url"
git fetch --progress origin
git remote set-head origin -a || (
test -n "$rev" && echo "that's ok, we want $rev" || exit 1)
if test -n "$rev"; then
echo "Trying to checkout: $rev"
parsed_rev=$(
git rev-parse --verify "$rev" 2>/dev/null ||
git rev-parse --verify origin/"$rev" 2>/dev/null
)
git reset --hard $parsed_rev
git checkout -b __nixos_build__
else
git checkout -b __nixos_build__ origin/HEAD
fi
if test -f .gitmodules; then
git submodule update --init
fi
if test -z "$leaveDotGit"; then
find $out -name .git\* | xargs rm -rf
fi
$fetcher --builder --url "$url" --out "$out" --rev "$rev" ${leaveDotGit:+--leave-dotGit}
stopNest