Skip to content
Snippets Groups Projects
Commit 5304a1eb authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

* Fetchurl: check md5 checksum.

parent 73b163c1
No related branches found
No related tags found
No related merge requests found
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")))
]
)
......
#! /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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment