1if [ -e .attrs.sh ]; then source .attrs.sh; fi
2source $stdenv/setup
3
4tagtext=""
5tagflags=""
6# Darcs hashes are sha1 (120 bits, 40-character hex)
7if [[ "$rev" =~ [a-fA-F0-9]{40} ]]; then
8 tagtext="(hash $rev)"
9 tagflags="--to-hash=$rev"
10elif test -n "$rev"; then
11 tagtext="(tag $rev)"
12 tagflags="--tag=$rev"
13elif test -n "$context"; then
14 tagtext="(context)"
15 tagflags="--context=$context"
16fi
17
18echo "getting $url $partial ${tagtext} into $out"
19
20darcs get --lazy $tagflags "$url" "$out"
21# remove metadata, because it can change
22rm -rf "$out/_darcs"