check-meta: fix 'hasNoMaintainers' (#412184)

authored by Aleksana and committed by GitHub eb480299 599ee121

+12 -2
+12 -2
pkgs/stdenv/generic/check-meta.nix
··· 110 110 hasUnfreeLicense = attrs: hasLicense attrs && isUnfree attrs.meta.license; 111 111 112 112 hasNoMaintainers = 113 + # To get usable output, we want to avoid flagging "internal" derivations. 114 + # Because we do not have a way to reliably decide between internal or 115 + # external derivation, some heuristics are required to decide. 116 + # 117 + # If `outputHash` is defined, the derivation is a FOD, such as the output of a fetcher. 118 + # If `description` is not defined, the derivation is probably not a package. 119 + # Simply checking whether `meta` is defined is insufficient, 120 + # as some fetchers and trivial builders do define meta. 113 121 attrs: 114 - (attrs ? meta.maintainers && (length attrs.meta.maintainers) == 0) 115 - && (attrs ? meta.teams && (length attrs.meta.teams) == 0); 122 + (!attrs ? outputHash) 123 + && (attrs ? meta.description) 124 + && (attrs.meta.maintainers or [ ] == [ ]) 125 + && (attrs.meta.teams or [ ] == [ ]); 116 126 117 127 isMarkedBroken = attrs: attrs.meta.broken or false; 118 128