Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1tagtext=""
2tagflags=""
3# Darcs hashes are sha1 (120 bits, 40-character hex)
4if [[ "$rev" =~ [a-fA-F0-9]{40} ]]; then
5 tagtext="(hash $rev)"
6 tagflags="--to-hash=$rev"
7elif test -n "$rev"; then
8 tagtext="(tag $rev)"
9 tagflags="--tag=$rev"
10elif test -n "$context"; then
11 tagtext="(context)"
12 tagflags="--context=$context"
13fi
14
15echo "getting $url $partial ${tagtext} into $out"
16
17darcs get --lazy $tagflags "$url" "$out"
18# remove metadata, because it can change
19rm -rf "$out/_darcs"