]> code.ossystems Code Review - openembedded-core.git/commitdiff
license.bbclass: Gather Pkg level licenses
authorElizabeth Flanagan <elizabeth.flanagan@intel.com>
Fri, 24 Feb 2012 22:17:38 +0000 (14:17 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 24 Feb 2012 23:24:14 +0000 (23:24 +0000)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license.bbclass

index 10a937b10c4a8cc0fad75279b1fefab27b501117..11908d90dac27b22f8bda23eafe8015084192bed 100644 (file)
@@ -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)