
It's hard to put the sourcing of ./.attrs.sh into all builder consistently - mistakes will happen. Thus, load structured attrs once in make-derivation and then source the remaining builder on top. This should fix quite a few builders with structured attributes in principle. Most importantly it helps substitute / substituteAll, which are required for bootstrap on some platforms.
20 lines
496 B
Bash
20 lines
496 B
Bash
tagtext=""
|
|
tagflags=""
|
|
# 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
|
|
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"
|