Don't barf JSON at users in error messages

+5 -3
+5 -3
pkgs/stdenv/generic/default.nix
··· 27 lib.lists.all (license: 28 let l = lib.licenses.${license.shortName or "BROKEN"} or false; in 29 if license == l then true else 30 - throw ''‘${builtins.toJSON license}’ is not an attribute of lib.licenses'' 31 ) list; 32 33 mutuallyExclusive = a: b: ··· 72 hasLicense attrs && 73 isUnfree (lib.lists.toList attrs.meta.license) && 74 !allowUnfreePredicate attrs; 75 76 defaultNativeBuildInputs = extraBuildInputs ++ 77 [ ../../build-support/setup-hooks/move-docs.sh ··· 121 122 licenseAllowed = attrs: 123 if hasDeniedUnfreeLicense attrs && !(hasWhitelistedLicense attrs) then 124 - throwEvalHelp "Unfree" "has an unfree license ‘${builtins.toJSON attrs.meta.license}’ which is not whitelisted" 125 else if hasBlacklistedLicense attrs then 126 - throwEvalHelp "blacklisted" "has the ‘${builtins.toJSON attrs.meta.license}’ license which is blacklisted" 127 else if !allowBroken && attrs.meta.broken or false then 128 throwEvalHelp "Broken" "is marked as broken" 129 else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem result.system attrs.meta.platforms then
··· 27 lib.lists.all (license: 28 let l = lib.licenses.${license.shortName or "BROKEN"} or false; in 29 if license == l then true else 30 + throw ''‘${showLicense license}’ is not an attribute of lib.licenses'' 31 ) list; 32 33 mutuallyExclusive = a: b: ··· 72 hasLicense attrs && 73 isUnfree (lib.lists.toList attrs.meta.license) && 74 !allowUnfreePredicate attrs; 75 + 76 + showLicense = license: license.shortName or "unknown"; 77 78 defaultNativeBuildInputs = extraBuildInputs ++ 79 [ ../../build-support/setup-hooks/move-docs.sh ··· 123 124 licenseAllowed = attrs: 125 if hasDeniedUnfreeLicense attrs && !(hasWhitelistedLicense attrs) then 126 + throwEvalHelp "Unfree" "has an unfree license (‘${showLicense attrs.meta.license}’)" 127 else if hasBlacklistedLicense attrs then 128 + throwEvalHelp "blacklisted" "has a blacklisted license (‘${showLicense attrs.meta.license}’)" 129 else if !allowBroken && attrs.meta.broken or false then 130 throwEvalHelp "Broken" "is marked as broken" 131 else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem result.system attrs.meta.platforms then