fetchhg: fix hash assertion; make overridable when sha256 set (#423877)

This commit is contained in:
Philip Taron
2025-07-10 14:40:27 -07:00
committed by GitHub
+8 -10
View File
@@ -30,16 +30,14 @@ lib.extendMkDerivation {
outputHashAlgo = if finalAttrs.hash != null && finalAttrs.hash != "" then null else "sha256";
outputHashMode = "recursive";
outputHash =
lib.throwIf (finalAttrs.hash != null && sha256 != null) "Only one of sha256 or hash can be set"
(
if finalAttrs.hash != null then
finalAttrs.hash
else if sha256 != null then
sha256
else
""
);
outputHash = lib.throwIf (hash != null && sha256 != null) "Only one of sha256 or hash can be set" (
if finalAttrs.hash != null then
finalAttrs.hash
else if sha256 != null then
sha256
else
""
);
inherit url rev hash;
inherit preferLocalBuild;