about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-04-17 17:23:50 -0400
committerGitHub <noreply@github.com>2018-04-17 17:23:50 -0400
commit9edda8aef1a79d7d7374bfaf4346ac0a93e4758d (patch)
treeefb40e3a51f5a295eb868a35a197a685ec210bd7 /pkgs
parentb1bdcfff580b74a39112c70b0c44ee3bbb9530df (diff)
parentc66440c1048387599e002a1c2d17ba5cbaebf3f8 (diff)
downloadnixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.tar
nixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.tar.gz
nixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.tar.bz2
nixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.tar.lz
nixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.tar.xz
nixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.tar.zst
nixlib-9edda8aef1a79d7d7374bfaf4346ac0a93e4758d.zip
Merge pull request #38639 from shlevy/platforms-not-broken
meta: Don't bypass unsupported platforms with allowBroken.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/stdenv/generic/check-meta.nix14
1 files changed, 9 insertions, 5 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix
index 26522ad6045e..11c11b5d77b0 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -8,7 +8,8 @@ let
   # for why this defaults to false, but I (@copumpkin) want to default it to true soon.
   shouldCheckMeta = config.checkMeta or false;
 
-  allowUnfree = config.allowUnfree or false || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
+  allowUnfree = config.allowUnfree or false
+    || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1";
 
   whitelist = config.whitelistedLicenses or [];
   blacklist = config.blacklistedLicenses or [];
@@ -35,9 +36,11 @@ let
   hasBlacklistedLicense = assert areLicenseListsValid; attrs:
     hasLicense attrs && builtins.elem attrs.meta.license blacklist;
 
-  allowBroken = config.allowBroken or false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
+  allowBroken = config.allowBroken or false
+    || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1";
 
-  allowUnsupportedSystem = config.allowUnsupportedSystem or false;
+  allowUnsupportedSystem = config.allowUnsupportedSystem or false
+    || builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1";
 
   isUnfree = licenses: lib.lists.any (l:
     !l.free or true || l == "unfree" || l == "unfree-redistributable") licenses;
@@ -75,6 +78,7 @@ let
   remediation = {
     unfree = remediate_whitelist "Unfree";
     broken = remediate_whitelist "Broken";
+    unsupported = remediate_whitelist "UnsupportedSystem";
     blacklisted = x: "";
     insecure = remediate_insecure;
     unknown-meta = x: "";
@@ -192,8 +196,8 @@ let
       { valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; }
     else if !allowBroken && attrs.meta.broken or false then
       { valid = false; reason = "broken"; errormsg = "is marked as broken"; }
-    else if !allowUnsupportedSystem && !allowBroken && !(checkPlatform attrs) then
-      { valid = false; reason = "broken"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
+    else if !allowUnsupportedSystem && !(checkPlatform attrs) then
+      { valid = false; reason = "unsupported"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
     else if !(hasAllowedInsecure attrs) then
       { valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }
     else let res = checkMeta (attrs.meta or {}); in if res != [] then