mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
Merge pull request #247111 from K900/requirefile-fix-error-message
requireFile: fix error message with SRI hashes
This commit is contained in:
commit
fe0f28c09d
|
@ -824,9 +824,10 @@ rec {
|
|||
or
|
||||
nix-prefetch-url --type ${hashAlgo} file:///path/to/${name_}
|
||||
'';
|
||||
hashAlgo = if hash != null then ""
|
||||
hashAlgo = if hash != null then (builtins.head (lib.strings.splitString "-" hash))
|
||||
else if sha256 != null then "sha256"
|
||||
else "sha1";
|
||||
hashAlgo_ = if hash != null then "" else hashAlgo;
|
||||
hash_ = if hash != null then hash
|
||||
else if sha256 != null then sha256
|
||||
else sha1;
|
||||
|
@ -835,7 +836,7 @@ rec {
|
|||
stdenvNoCC.mkDerivation {
|
||||
name = name_;
|
||||
outputHashMode = hashMode;
|
||||
outputHashAlgo = hashAlgo;
|
||||
outputHashAlgo = hashAlgo_;
|
||||
outputHash = hash_;
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
|
|
Loading…
Reference in a new issue