stdenv.hasLicense: ? supports nested lookup
this avoids one copy of the attrset
This commit is contained in:
parent
89672d530b
commit
43ce115ca9
|
@ -44,7 +44,7 @@ let
|
||||||
throw "whitelistedLicenses and blacklistedLicenses are not mutually exclusive.";
|
throw "whitelistedLicenses and blacklistedLicenses are not mutually exclusive.";
|
||||||
|
|
||||||
hasLicense = attrs:
|
hasLicense = attrs:
|
||||||
builtins.hasAttr "meta" attrs && builtins.hasAttr "license" attrs.meta;
|
attrs ? meta.license;
|
||||||
|
|
||||||
hasWhitelistedLicense = assert areLicenseListsValid; attrs:
|
hasWhitelistedLicense = assert areLicenseListsValid; attrs:
|
||||||
hasLicense attrs && builtins.elem attrs.meta.license whitelist;
|
hasLicense attrs && builtins.elem attrs.meta.license whitelist;
|
||||||
|
|
Loading…
Reference in a new issue