about summary refs log tree commit diff
path: root/corepkgs/fetchurl
diff options
context:
space:
mode:
Diffstat (limited to 'corepkgs/fetchurl')
-rw-r--r--corepkgs/fetchurl/fetchurl.fix4
-rw-r--r--corepkgs/fetchurl/fetchurl.sh9
2 files changed, 10 insertions, 3 deletions
diff --git a/corepkgs/fetchurl/fetchurl.fix b/corepkgs/fetchurl/fetchurl.fix
index a3b3d46e10e9..f798c0becbc2 100644
--- a/corepkgs/fetchurl/fetchurl.fix
+++ b/corepkgs/fetchurl/fetchurl.fix
@@ -1,8 +1,8 @@
-Function(["url", "hash"],
+Function(["url", "md5"],
   Package(
     [ ("build", Relative("fetchurl/fetchurl.sh"))
     , ("url", Var("url"))
-    , ("hash", Var("hash"))
+    , ("md5", Var("md5"))
     , ("name", BaseName(Var("url")))
     ]
   )
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