about summary refs log tree commit diff
path: root/corepkgs/fetchurl/fetchurl.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-12T11·03+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-12T11·03+0000
commit5304a1eb3a2bbcc379924d3f5a58b64ce77f4849 (patch)
tree6c428995c253d8f33a9b3e82fcc9ab1e5db4ef27 /corepkgs/fetchurl/fetchurl.sh
parent73b163c1a10f2ce675d9fc3d7ad02fad4bc6511f (diff)
* Fetchurl: check md5 checksum.
Diffstat (limited to 'corepkgs/fetchurl/fetchurl.sh')
-rw-r--r--corepkgs/fetchurl/fetchurl.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/corepkgs/fetchurl/fetchurl.sh b/corepkgs/fetchurl/fetchurl.sh
index a92092c6ee09..7b6243974d3f 100644
--- a/corepkgs/fetchurl/fetchurl.sh
+++ b/corepkgs/fetchurl/fetchurl.sh
@@ -1,3 +1,10 @@
 #! /bin/sh
 
-wget "$url" -O "$out"
+echo "downloading $url into $out..."
+wget "$url" -O "$out" || exit 1
+
+actual=$(md5sum -b $out | cut -c1-32)
+if ! test "$actual" == "$md5"; then
+    echo "hash is $actual, expected $md5"
+    exit 1
+fi