summary refs log tree commit diff
path: root/pkgs/build-support/fetchdarcs/builder.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/fetchdarcs/builder.sh')
-rw-r--r--pkgs/build-support/fetchdarcs/builder.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchdarcs/builder.sh b/pkgs/build-support/fetchdarcs/builder.sh
index ce5537f46f40d..75b9066dba6f4 100644
--- a/pkgs/build-support/fetchdarcs/builder.sh
+++ b/pkgs/build-support/fetchdarcs/builder.sh
@@ -3,11 +3,15 @@ source $stdenv/setup
 
 tagtext=""
 tagflags=""
-if test -n "$rev"; then
-    tagtext="(tag $rev) "
+# 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) "
+    tagtext="(context)"
     tagflags="--context=$context"
 fi