summary refs log tree commit diff
path: root/pkgs/build-support/fetchcvs/builder.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/fetchcvs/builder.sh')
-rw-r--r--pkgs/build-support/fetchcvs/builder.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchcvs/builder.sh b/pkgs/build-support/fetchcvs/builder.sh
new file mode 100644
index 000000000000..55a87c1660ad
--- /dev/null
+++ b/pkgs/build-support/fetchcvs/builder.sh
@@ -0,0 +1,24 @@
+source $stdenv/setup
+
+header "exporting $url $module into $out"
+
+prefetch=$(dirname $out)/cvs-checkout-tmp-$outputHash
+echo $prefetch
+if test -e "$prefetch"; then
+    mv $prefetch $out
+else
+    if test -z "$tag"; then
+      rtag="-DNOW"
+    else
+      rtag="-r $tag"
+    fi
+    cvs -f -d $url export $rtag -d $out $module
+fi
+
+actual=$(nix-hash $out)
+if test "$actual" != "$outputHash"; then
+    echo "hash is $actual, expected $outputHash" >&2
+    exit 1
+fi
+
+stopNest