fetchhg: fix hash assertion; make overridable when sha256 set

Fix commit ef2f8315bf53 ("fetchhg: make argument hash overridable")
This commit is contained in:
Yueh-Shun Li 2025-07-10 03:36:26 +08:00
parent 07f4a23c3c
commit 49ec48c3db

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;