nixpkgs/pkgs/build-support/fetchdarcs/builder.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
565 B
Bash
Raw Normal View History

if [ -e .attrs.sh ]; then source .attrs.sh; fi
source $stdenv/setup
tagtext=""
tagflags=""
2022-12-05 19:49:37 +00:00
# Darcs hashes are sha1 (120 bits, 40-character hex)
if [[ "$rev" =~ [a-fA-F0-9]{40} ]]; then
tagtext="(hash $rev)"
tagflags="--to-hash=$rev"
elif test -n "$rev"; then
tagtext="(tag $rev)"
tagflags="--tag=$rev"
elif test -n "$context"; then
2022-12-05 19:49:37 +00:00
tagtext="(context)"
tagflags="--context=$context"
fi
echo "getting $url $partial ${tagtext} into $out"
darcs get --lazy $tagflags "$url" "$out"
# remove metadata, because it can change
rm -rf "$out/_darcs"