Patchwork [2/3] license.bbclass: Gather Pkg level licenses

login
register
mail settings
Submitter Elizabeth Flanagan
Date Feb. 24, 2012, 10:17 p.m.
Message ID <ccf71508a19ca420d7694335c1890140d9d7fa79.1330121220.git.elizabeth.flanagan@intel.com>
Download mbox | patch
Permalink /patch/21987/
State Accepted
Commit d50dd280f52587b6225bc5db3c9e85f78107f5f5
Headers show

Comments

Elizabeth Flanagan - Feb. 24, 2012, 10:17 p.m.
From: Elizabeth Flanagan <elizabeth.flanagan@intel.com>

We should look for LICENSE at a package level first. If it's
not found, we should use the recipe level LICENSE. This adds a
bit more granularity to license manifests where needed.

Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com>
---
 meta/classes/license.bbclass |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 10a937b..11908d9 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -140,8 +140,20 @@  python do_populate_lic() {
     import shutil
     import oe.license
 
-    # All the license types for the package
-    license_types = d.getVar('LICENSE', True)
+    pn = d.getVar('PN', True)
+    for package in d.getVar('PACKAGES', True):
+        if d.getVar('LICENSE_' + pn + '-' + package, True):
+            license_types = license_types + ' & ' + \
+                            d.getVar('LICENSE_' + pn + '-' + package, True)
+
+    #If we get here with no license types, then that means we have a recipe 
+    #level license. If so, we grab only those.
+    try:
+        license_types
+    except NameError:        
+        # All the license types at the recipe level
+        license_types = d.getVar('LICENSE', True)
+ 
     # All the license files for the package
     lic_files = d.getVar('LIC_FILES_CHKSUM', True)
     pn = d.getVar('PN', True)