Unverified Commit fe0f28c0 authored by K900's avatar K900 Committed by GitHub
Browse files

Merge pull request #247111 from K900/requirefile-fix-error-message

requireFile: fix error message with SRI hashes
parents abb697a0 8bd0cd85
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;