summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-02-06 15:00:33 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-02-06 15:00:33 +0100
commitf337ab4430e972c183ef9aa6c54275bf8c996ab2 (patch)
treeec6d544358b78d9877bf23f520025856cb9c3fcb /pkgs/build-support
parent6b702f23eaf6c99d4d8a3aaee88804fa14d68bfc (diff)
downloadnixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.tar
nixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.tar.gz
nixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.tar.bz2
nixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.tar.lz
nixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.tar.xz
nixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.tar.zst
nixlib-f337ab4430e972c183ef9aa6c54275bf8c996ab2.zip
fetchurl: Remove some compatibility hacks
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/fetchurl/builder.sh14
-rw-r--r--pkgs/build-support/fetchurl/default.nix16
2 files changed, 5 insertions, 25 deletions
diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh
index 808bf9f7cdec..4af060cadc68 100644
--- a/pkgs/build-support/fetchurl/builder.sh
+++ b/pkgs/build-support/fetchurl/builder.sh
@@ -29,20 +29,6 @@ tryDownload() {
 
 
 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
     exit 0
 }
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix
index cc59dd7fab1e..02af2aaf5712 100644
--- a/pkgs/build-support/fetchurl/default.nix
+++ b/pkgs/build-support/fetchurl/default.nix
@@ -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";