From fc687b393f24e3a014d935b04e5860fb19bb36e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Mon, 21 Oct 2013 21:56:45 +0200 Subject: [PATCH] Small fix in handling of "unfree" meta.license attributes meta.license is can be a string or a list of strings. But there is one unhandled case where "unfree" (or "unfree-redistributable") is a part of a list. It will currently not be detected as an "unfree" package and Hydra will attempt to build it. This should fix it. Example: http://hydra.nixos.org/build/6553461 --- pkgs/stdenv/generic/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 0b1003a73921..f8aff33a327f 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -49,7 +49,7 @@ let # Add a utility function to produce derivations that use this # stdenv and its shell. mkDerivation = attrs: - if !allowUnfree && (let l = attrs.meta.license or ""; in l == "unfree" || l == "unfree-redistributable") then + if !allowUnfree && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) then throw "package ‘${attrs.name}’ has an unfree license, refusing to evaluate" else lib.addPassthru (derivation (