stdenv.hasLicense: ? supports nested lookup

this avoids one copy of the attrset
This commit is contained in:
Alexander Ried 2016-10-22 02:10:38 +02:00
parent 89672d530b
commit 43ce115ca9

View file

@ -44,7 +44,7 @@ let
throw "whitelistedLicenses and blacklistedLicenses are not mutually exclusive.";
hasLicense = attrs:
builtins.hasAttr "meta" attrs && builtins.hasAttr "license" attrs.meta;
attrs ? meta.license;
hasWhitelistedLicense = assert areLicenseListsValid; attrs:
hasLicense attrs && builtins.elem attrs.meta.license whitelist;