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