nixpkgs/pkgs/build-support/fetchurl/builder.sh
Eelco Dolstra ab7af4709a * Add `--fail' to curl invocation to catch errors.
svn path=/nixpkgs/trunk/; revision=889
2004-04-01 12:23:02 +00:00

14 lines
223 B
Bash

. $stdenv/setup
header "downloading $out from $url"
curl --fail "$url" > "$out"
actual=$(md5sum -b "$out" | cut -c1-32)
if test "$actual" != "$md5"; then
echo "hash is $actual, expected $md5"
exit 1
fi
stopNest