mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge pull request #72070 from graham33/fix/license_list
Fix handling of lists in whitelistedLicenses and blacklistedLicenses
This commit is contained in:
commit
a6a3958c26
1 changed files with 3 additions and 3 deletions
|
@ -36,10 +36,10 @@ let
|
||||||
attrs ? meta.license;
|
attrs ? meta.license;
|
||||||
|
|
||||||
hasWhitelistedLicense = assert areLicenseListsValid; attrs:
|
hasWhitelistedLicense = assert areLicenseListsValid; attrs:
|
||||||
hasLicense attrs && builtins.elem attrs.meta.license whitelist;
|
hasLicense attrs && lib.lists.any (l: builtins.elem l whitelist) (lib.lists.toList attrs.meta.license);
|
||||||
|
|
||||||
hasBlacklistedLicense = assert areLicenseListsValid; attrs:
|
hasBlacklistedLicense = assert areLicenseListsValid; attrs:
|
||||||
hasLicense attrs && builtins.elem attrs.meta.license blacklist;
|
hasLicense attrs && lib.lists.any (l: builtins.elem l blacklist) (lib.lists.toList attrs.meta.license);
|
||||||
|
|
||||||
allowBroken = config.allowBroken or false
|
allowBroken = config.allowBroken or false
|
||||||
|| builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
|
|| builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
|
||||||
|
@ -75,7 +75,7 @@ let
|
||||||
allowInsecurePredicate attrs ||
|
allowInsecurePredicate attrs ||
|
||||||
builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1";
|
builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1";
|
||||||
|
|
||||||
showLicense = license: license.shortName or "unknown";
|
showLicense = license: toString (map (l: l.shortName or "unknown") (lib.lists.toList license));
|
||||||
|
|
||||||
pos_str = meta: meta.position or "«unknown-file»";
|
pos_str = meta: meta.position or "«unknown-file»";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue