]> code.ossystems Code Review - openembedded-core.git/commitdiff
meta: Further LICENSE_FLAGS variable updates
authorSaul Wold <Saul.Wold@windriver.com>
Mon, 21 Feb 2022 23:39:03 +0000 (15:39 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Feb 2022 23:43:49 +0000 (23:43 +0000)
Add further tweaks to comments and variable names for license variable change.

Signed-off-by: Saul Wold <saul.wold@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/base.bbclass
meta/classes/license.bbclass

index be820ddb2c24792be5205ec1d7040d801139d9c8..227f1f5a756683e40b7d73f7884521faa13a125d 100644 (file)
@@ -542,9 +542,9 @@ python () {
         unmatched_license_flags = check_license_flags(d)
         if unmatched_license_flags:
             if len(unmatched_license_flags) == 1:
-                message = "because it has a restricted license '{0}'. Which is not whitelisted in LICENSE_FLAGS_ACCEPTED".format(unmatched_license_flags[0])
+                message = "because it has a restricted license '{0}'. Which is not listed in LICENSE_FLAGS_ACCEPTED".format(unmatched_license_flags[0])
             else:
-                message = "because it has restricted licenses {0}. Which are not whitelisted in LICENSE_FLAGS_ACCEPTED".format(
+                message = "because it has restricted licenses {0}. Which are not listed in LICENSE_FLAGS_ACCEPTED".format(
                     ", ".join("'{0}'".format(f) for f in unmatched_license_flags))
             bb.debug(1, "Skipping %s %s" % (pn, message))
             raise bb.parse.SkipRecipe(message)
index dd1e07ee377a7bfb88950f74d498bfea8ebdc0a7..dec986720967bb03437176250f62a798573c7364 100644 (file)
@@ -341,30 +341,31 @@ def incompatible_license(d, dont_want_licenses, package=None):
 def check_license_flags(d):
     """
     This function checks if a recipe has any LICENSE_FLAGS that
-    aren't whitelisted.
+    aren't acceptable.
 
-    If it does, it returns the all LICENSE_FLAGS missing from the whitelist, or
-    all of the LICENSE_FLAGS if there is no whitelist.
+    If it does, it returns the all LICENSE_FLAGS missing from the list
+    of acceptable license flags, or all of the LICENSE_FLAGS if there
+    is no list of acceptable flags.
 
-    If everything is is properly whitelisted, it returns None.
+    If everything is is acceptable, it returns None.
     """
 
-    def license_flag_matches(flag, whitelist, pn):
+    def license_flag_matches(flag, acceptlist, pn):
         """
-        Return True if flag matches something in whitelist, None if not.
+        Return True if flag matches something in acceptlist, None if not.
 
-        Before we test a flag against the whitelist, we append _${PN}
+        Before we test a flag against the acceptlist, we append _${PN}
         to it.  We then try to match that string against the
-        whitelist.  This covers the normal case, where we expect
+        acceptlist.  This covers the normal case, where we expect
         LICENSE_FLAGS to be a simple string like 'commercial', which
-        the user typically matches exactly in the whitelist by
+        the user typically matches exactly in the acceptlist by
         explicitly appending the package name e.g 'commercial_foo'.
         If we fail the match however, we then split the flag across
         '_' and append each fragment and test until we either match or
         run out of fragments.
         """
         flag_pn = ("%s_%s" % (flag, pn))
-        for candidate in whitelist:
+        for candidate in acceptlist:
             if flag_pn == candidate:
                     return True
 
@@ -375,27 +376,27 @@ def check_license_flags(d):
             if flag_cur:
                 flag_cur += "_"
             flag_cur += flagment
-            for candidate in whitelist:
+            for candidate in acceptlist:
                 if flag_cur == candidate:
                     return True
         return False
 
-    def all_license_flags_match(license_flags, whitelist):
+    def all_license_flags_match(license_flags, acceptlist):
         """ Return all unmatched flags, None if all flags match """
         pn = d.getVar('PN')
-        split_whitelist = whitelist.split()
+        split_acceptlist = acceptlist.split()
         flags = []
         for flag in license_flags.split():
-            if not license_flag_matches(flag, split_whitelist, pn):
+            if not license_flag_matches(flag, split_acceptlist, pn):
                 flags.append(flag)
         return flags if flags else None
 
     license_flags = d.getVar('LICENSE_FLAGS')
     if license_flags:
-        whitelist = d.getVar('LICENSE_FLAGS_ACCEPTED')
-        if not whitelist:
+        acceptlist = d.getVar('LICENSE_FLAGS_ACCEPTED')
+        if not acceptlist:
             return license_flags.split()
-        unmatched_flags = all_license_flags_match(license_flags, whitelist)
+        unmatched_flags = all_license_flags_match(license_flags, acceptlist)
         if unmatched_flags:
             return unmatched_flags
     return None