about summary refs log tree commit diff
path: root/corepkgs/fetchurl/builder.sh.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-22T18·45+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-22T18·45+0000
commitab0bc4999a49efbc8e1c25989662a96e32fa0cc5 (patch)
tree3864cf300fccb46a97decd2d00b8176c047a87d0 /corepkgs/fetchurl/builder.sh.in
parent40d9eb14dfb842c51e9f86818b43ae7711e1a5d6 (diff)
* Maintain integrity of the substitute and successor mappings when
  deleting a path in the store.
* Allow absolute paths in Nix expressions.
* Get nix-prefetch-url to work again.
* Various other fixes.

Diffstat (limited to 'corepkgs/fetchurl/builder.sh.in')
-rw-r--r--corepkgs/fetchurl/builder.sh.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/corepkgs/fetchurl/builder.sh.in b/corepkgs/fetchurl/builder.sh.in
new file mode 100644
index 000000000000..a6cc6993028a
--- /dev/null
+++ b/corepkgs/fetchurl/builder.sh.in
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+export PATH=/bin:/usr/bin
+
+echo "downloading $url into $out..."
+
+prefetch=@prefix@/store/nix-prefetch-url-$md5
+if test -f "$prefetch"; then
+    echo "using prefetched $prefetch";
+    mv $prefetch $out || exit 1
+else
+    @wget@ --passive-ftp "$url" -O "$out" || exit 1
+fi
+
+actual=$(@bindir@/nix-hash --flat $out)
+if test "$actual" != "$md5"; then
+    echo "hash is $actual, expected $md5"
+    exit 1
+fi