mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
fetchNuGet: add SRI hash support
This commit is contained in:
parent
3c89ee1b7b
commit
9aee77e045
@ -5,15 +5,19 @@ attrs @
|
||||
, version
|
||||
, url ? "https://www.nuget.org/api/v2/package/${pname}/${version}"
|
||||
, sha256 ? ""
|
||||
, hash ? ""
|
||||
, md5 ? ""
|
||||
, ...
|
||||
}:
|
||||
if md5 != "" then
|
||||
throw "fetchnuget does not support md5 anymore, please use sha256"
|
||||
throw "fetchnuget does not support md5 anymore, please use 'hash' attribute with SRI hash"
|
||||
# This is also detected in fetchurl, but we just throw here to avoid confusion
|
||||
else if (sha256 != "" && hash != "") then
|
||||
throw "multiple hashes passed to fetchNuGet"
|
||||
else
|
||||
buildDotnetPackage ({
|
||||
src = fetchurl {
|
||||
inherit url sha256;
|
||||
inherit url sha256 hash;
|
||||
name = "${pname}.${version}.zip";
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user