Patchwork [3/5] base.bbclass: replace COMMERCIAL_LICENSE code with LICENSE_FLAGS code

login
register
mail settings
Submitter Tom Zanussi
Date Jan. 20, 2012, 6:52 p.m.
Message ID <e33d9744af1b0ab1c95930db23e3ee5d59b90624.1327084753.git.tom.zanussi@intel.com>
Download mbox | patch
Permalink /patch/19859/
State Accepted
Commit 3735716996ec11691054d7f03db873afde89b143
Headers show

Comments

Tom Zanussi - Jan. 20, 2012, 6:52 p.m.
From: Tom Zanussi <tom.zanussi@intel.com>

The COMMERCIAL_LICENSE mechanism has been superseded by LICENSE_FLAGS
so remove the code that implements COMMERCIAL_LICENSE and replace it
with the corresponding LICENSE_FLAGS version.

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
 meta/classes/base.bbclass |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 091e965..bb3c38d 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -349,12 +349,12 @@  python () {
     if license == "INVALID":
         bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn)
 
-    commercial_license = " %s " % d.getVar('COMMERCIAL_LICENSE', 1)
-    import re
-    pnr = "[ \t]%s[ \t]" % pn.replace('+', "\+")
-    if commercial_license and re.search(pnr, commercial_license):
-        bb.debug(1, "Skipping %s because it's commercially licensed" % pn)
-        raise bb.parse.SkipPackage("because it may require a commercial license to ship in a product (listed in COMMERCIAL_LICENSE)")
+    unmatched_license_flag = check_license_flags(d)
+    if unmatched_license_flag:
+        bb.debug(1, "Skipping %s because it has a restricted license not"
+             " whitelisted in LICENSE_FLAGS_WHITELIST" % pn)
+        raise bb.parse.SkipPackage("because it has a restricted license not"
+             " whitelisted in LICENSE_FLAGS_WHITELIST")
 
     # If we're building a target package we need to use fakeroot (pseudo)
     # in order to capture permissions, owners, groups and special files