mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 21:21:06 +00:00
fetch*: print a trace warning about md5 deprecation
This commit is contained in:
parent
c6b050fd2f
commit
f603dc11a6
|
@ -113,4 +113,7 @@ rec {
|
|||
*/
|
||||
warn = msg: builtins.trace "WARNING: ${msg}";
|
||||
info = msg: builtins.trace "INFO: ${msg}";
|
||||
|
||||
fetchMD5warn = name: context : data : warn
|
||||
"Deprecated use of MD5 hash in ${name} to fetch ${context}" data;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ stdenv.mkDerivation {
|
|||
|
||||
outputHashAlgo = if sha256 == "" then "md5" else "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if sha256 == "" then md5 else sha256;
|
||||
outputHash = if sha256 == "" then
|
||||
(stdenv.lib.fetchMD5warn "fetchdarcs" url md5) else sha256;
|
||||
|
||||
inherit url rev context;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@ stdenv.mkDerivation {
|
|||
|
||||
outputHashAlgo = if sha256 == "" then "md5" else "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if sha256 == "" then md5 else sha256;
|
||||
outputHash = if sha256 == "" then
|
||||
(stdenv.lib.fetchMD5warn "fetchegg" name md5) else sha256;
|
||||
|
||||
inherit version;
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
{stdenv}: {pathname, md5}: stdenv.mkDerivation {
|
||||
{stdenv}: {pathname, md5 ? "", sha256 ? ""}: stdenv.mkDerivation {
|
||||
name = baseNameOf (toString pathname);
|
||||
builder = ./builder.sh;
|
||||
pathname = pathname;
|
||||
md5 = md5;
|
||||
} // if (sha256 == "") then {
|
||||
md5 = (stdenv.lib.fetchMD5warn "fetchfile" pathname md5);
|
||||
id = md5;
|
||||
} else {
|
||||
sha256 = sha256;
|
||||
id = sha256;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ stdenv.mkDerivation {
|
|||
|
||||
outputHashAlgo = if sha256 == "" then "md5" else "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if sha256 == "" then md5 else sha256;
|
||||
outputHash = if sha256 == "" then
|
||||
(stdenv.lib.fetchMD5warn "fetchgit" url md5) else sha256;
|
||||
|
||||
inherit url rev leaveDotGit fetchSubmodules deepClone branchName;
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ stdenv.mkDerivation {
|
|||
|
||||
outputHashAlgo = if md5 != null then "md5" else "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if md5 != null then md5 else sha256;
|
||||
outputHash = if md5 != null then
|
||||
(stdenv.lib.fetchMD5warn "fetchhg" url md5) else sha256;
|
||||
|
||||
inherit url rev;
|
||||
preferLocalBuild = true;
|
||||
|
|
|
@ -29,7 +29,8 @@ stdenv.mkDerivation {
|
|||
|
||||
outputHashAlgo = if sha256 == "" then "md5" else "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if sha256 == "" then md5 else sha256;
|
||||
outputHash = if sha256 == "" then
|
||||
(stdenv.lib.fetchMD5warn "fetchsvn" url md5) else sha256;
|
||||
|
||||
inherit url rev sshSupport openssh ignoreExternals;
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ stdenv.mkDerivation {
|
|||
|
||||
outputHashAlgo = if sha256 == "" then "md5" else "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = if sha256 == "" then md5 else sha256;
|
||||
outputHash = if sha256 == "" then
|
||||
(stdenv.lib.fetchMD5warn "fetchsvnssh" url md5) else sha256;
|
||||
|
||||
sshSubversion = ./sshsubversion.exp;
|
||||
|
||||
|
|
|
@ -112,7 +112,8 @@ if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${s
|
|||
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
||||
if sha512 != "" then "sha512" else if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
||||
outputHash = if outputHash != "" then outputHash else
|
||||
if sha512 != "" then sha512 else if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
||||
if sha512 != "" then sha512 else if sha256 != "" then sha256 else if sha1 != "" then sha1 else
|
||||
(stdenv.lib.fetchMD5warn "fetchurl" (builtins.head urls_) md5);
|
||||
|
||||
outputHashMode = if (recursiveHash || executable) then "recursive" else "flat";
|
||||
|
||||
|
|
Loading…
Reference in a new issue