2022-12-07 23:51:03 +00:00
|
|
|
if [ -e .attrs.sh ]; then source .attrs.sh; fi
|
2006-01-30 11:18:38 +00:00
|
|
|
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)"
|
2014-06-28 18:33:28 +00:00
|
|
|
tagflags="--tag=$rev"
|
2009-05-13 19:02:23 +00:00
|
|
|
elif test -n "$context"; then
|
2022-12-05 19:49:37 +00:00
|
|
|
tagtext="(context)"
|
2009-05-13 19:02:23 +00:00
|
|
|
tagflags="--context=$context"
|
2006-01-30 11:18:38 +00:00
|
|
|
fi
|
|
|
|
|
2023-01-15 22:08:12 +00:00
|
|
|
echo "getting $url $partial ${tagtext} into $out"
|
2006-01-30 11:18:38 +00:00
|
|
|
|
2012-10-22 13:02:33 +00:00
|
|
|
darcs get --lazy $tagflags "$url" "$out"
|
2006-01-30 11:18:38 +00:00
|
|
|
# remove metadata, because it can change
|
|
|
|
rm -rf "$out/_darcs"
|