fetchurl: Remove some compatibility hacks
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{stdenv, curl}: # Note that `curl' may be `null', in case of the native stdenv.
|
||||
{ stdenv, curl }: # Note that `curl' may be `null', in case of the native stdenv.
|
||||
|
||||
let
|
||||
|
||||
@@ -17,10 +17,7 @@ let
|
||||
|
||||
# Names of the master sites that are mirrored (i.e., "sourceforge",
|
||||
# "gnu", etc.).
|
||||
sites =
|
||||
if builtins ? attrNames
|
||||
then builtins.attrNames mirrors
|
||||
else [] /* backwards compatibility */;
|
||||
sites = builtins.attrNames mirrors;
|
||||
|
||||
impureEnvVars = [
|
||||
# We borrow these environment variables from the caller to allow
|
||||
@@ -38,7 +35,7 @@ let
|
||||
] ++ (map (site: "NIX_MIRRORS_${site}") sites);
|
||||
|
||||
in
|
||||
|
||||
|
||||
{ # URL to fetch.
|
||||
url ? ""
|
||||
|
||||
@@ -79,9 +76,9 @@ stdenv.mkDerivation {
|
||||
if showURLs then "urls"
|
||||
else if name != "" then name
|
||||
else baseNameOf (toString (builtins.head urls_));
|
||||
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
|
||||
buildInputs = [curl];
|
||||
|
||||
urls = urls_;
|
||||
@@ -90,9 +87,6 @@ stdenv.mkDerivation {
|
||||
# (http://nixos.org/tarballs) over the original URLs.
|
||||
preferHashedMirrors = true;
|
||||
|
||||
# Compatibility with Nix <= 0.7.
|
||||
id = md5;
|
||||
|
||||
# New-style output content requirements.
|
||||
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
||||
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
||||
|
||||
Reference in New Issue
Block a user