fetchurl: Remove some compatibility hacks
This commit is contained in:
parent
6b702f23ea
commit
f337ab4430
@ -29,20 +29,6 @@ tryDownload() {
|
|||||||
|
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
# On old versions of Nix, verify the hash of the output. On newer
|
|
||||||
# versions, Nix verifies the hash itself.
|
|
||||||
if test "$NIX_OUTPUT_CHECKED" != "1"; then
|
|
||||||
if test "$outputHashAlgo" != "md5"; then
|
|
||||||
echo "hashes other than md5 are unsupported in Nix <= 0.7, upgrade to Nix 0.8"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
actual=$(md5sum -b "$out" | cut -c1-32)
|
|
||||||
if test "$actual" != "$id"; then
|
|
||||||
echo "hash is $actual, expected $id"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
stopNest
|
stopNest
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,7 @@ let
|
|||||||
|
|
||||||
# Names of the master sites that are mirrored (i.e., "sourceforge",
|
# Names of the master sites that are mirrored (i.e., "sourceforge",
|
||||||
# "gnu", etc.).
|
# "gnu", etc.).
|
||||||
sites =
|
sites = builtins.attrNames mirrors;
|
||||||
if builtins ? attrNames
|
|
||||||
then builtins.attrNames mirrors
|
|
||||||
else [] /* backwards compatibility */;
|
|
||||||
|
|
||||||
impureEnvVars = [
|
impureEnvVars = [
|
||||||
# We borrow these environment variables from the caller to allow
|
# We borrow these environment variables from the caller to allow
|
||||||
@ -90,9 +87,6 @@ stdenv.mkDerivation {
|
|||||||
# (http://nixos.org/tarballs) over the original URLs.
|
# (http://nixos.org/tarballs) over the original URLs.
|
||||||
preferHashedMirrors = true;
|
preferHashedMirrors = true;
|
||||||
|
|
||||||
# Compatibility with Nix <= 0.7.
|
|
||||||
id = md5;
|
|
||||||
|
|
||||||
# New-style output content requirements.
|
# New-style output content requirements.
|
||||||
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
||||||
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user