stdenv.hasLicense: ? supports nested lookup
this avoids one copy of the attrset
commit43ce115ca91d34af1640f9ece2e5526e44dd2c7e
authorAlexander Ried <ried@mytum.de>
dateSat 22 Oct 2016, 02:10 (10 years ago)
parent89672d5
pkgs/stdenv/generic/default.nix+1−1
@@ -44,7 +44,7 @@ let
4444 throw "whitelistedLicenses and blacklistedLicenses are not mutually exclusive.";
4545
4646 hasLicense = attrs:
47− builtins.hasAttr "meta" attrs && builtins.hasAttr "license" attrs.meta;
47+ attrs ? meta.license;
4848
4949 hasWhitelistedLicense = assert areLicenseListsValid; attrs:
5050 hasLicense attrs && builtins.elem attrs.meta.license whitelist;