From dfc004e69c23cb48cce2c7537169a81b299a0af9 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Sun, 2 Jul 2017 09:32:43 +0200 Subject: lib.lists.mutuallyExclusive: add function --- pkgs/stdenv/generic/default.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'pkgs/stdenv/generic') diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 065f4fb508de..690b917b3762 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -45,13 +45,8 @@ let throw ''‘${showLicense license}’ is not an attribute of lib.licenses'' ) list; - mutuallyExclusive = a: b: - (builtins.length a) == 0 || - (!(builtins.elem (builtins.head a) b) && - mutuallyExclusive (builtins.tail a) b); - areLicenseListsValid = - if mutuallyExclusive whitelist blacklist then + if lib.mutuallyExclusive whitelist blacklist then assert onlyLicenses whitelist; assert onlyLicenses blacklist; true else throw "whitelistedLicenses and blacklistedLicenses are not mutually exclusive."; -- cgit 1.4.1