summary refs log tree commit diff
path: root/pkgs/build-support/fetchhg
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2017-03-13 13:31:44 +0100
committerRobin Gloster <mail@glob.in>2017-03-20 22:23:41 +0100
commitf57185db953670d6e4f334b7ad2dc79a96d703c4 (patch)
treeb306c2b35218daa92894a1256dd5dd32c2ff3698 /pkgs/build-support/fetchhg
parent1c3308e9c1dcbfc939b8cfd6d4f6e7b1c4b40748 (diff)
downloadnixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.tar
nixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.tar.gz
nixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.tar.bz2
nixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.tar.lz
nixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.tar.xz
nixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.tar.zst
nixpkgs-f57185db953670d6e4f334b7ad2dc79a96d703c4.zip
fetch-*: remove md5 support
fixes #4491
Diffstat (limited to 'pkgs/build-support/fetchhg')
-rw-r--r--pkgs/build-support/fetchhg/default.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkgs/build-support/fetchhg/default.nix b/pkgs/build-support/fetchhg/default.nix
index 79f610166a7..aba12317963 100644
--- a/pkgs/build-support/fetchhg/default.nix
+++ b/pkgs/build-support/fetchhg/default.nix
@@ -1,5 +1,8 @@
 {stdenv, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}:
 
+if md5 != null then
+  throw "fetchhg does not support md5 anymore, please use sha256"
+else
 # TODO: statically check if mercurial as the https support if the url starts woth https.
 stdenv.mkDerivation {
   name = "hg-archive" + (if name != null then "-${name}" else "");
@@ -8,14 +11,11 @@ stdenv.mkDerivation {
 
   impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
 
-  # Nix <= 0.7 compatibility.
-  id = md5;
-
   subrepoClause = if fetchSubrepos then "S" else "";
 
-  outputHashAlgo = if md5 != null then "md5" else "sha256";
+  outputHashAlgo = "sha256";
   outputHashMode = "recursive";
-  outputHash = if md5 != null then md5 else sha256;
+  outputHash = sha256;
 
   inherit url rev;
   preferLocalBuild = true;