Patchwork archiver.bbclass: check if package contains a copyleft license

login
register
mail settings
Submitter Kevin Strasser
Date June 12, 2013, 8:27 p.m.
Message ID <35f9a49eef9959320295599353215931260449e0.1371068581.git.kevin.strasser@linux.intel.com>
Download mbox | patch
Permalink /patch/51629/
State Accepted
Commit 3d0f9ee3d2fcce331d35467d5965ff44b825427f
Headers show

Comments

Kevin Strasser - June 12, 2013, 8:27 p.m.
The copyleft filter is only excluding packages that contain a
closed source license. This is because oe.license.is_included()
returns a boolean value that indicates if the license is excluded,
and a string that contains the matched included licenses. If the
string is empty it indicates that no licenses were matched.

Reject packages that do not contain a copyleft license.

[YOCTO 4630]

Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
---
 meta/classes/archiver.bbclass |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 6749d61..3d75d8e 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -63,7 +63,10 @@  def copyleft_should_include(d):
         bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
     else:
         if is_included:
-            return True, 'recipe has included licenses: %s' % ', '.join(reason)
+            if reason:
+                return True, 'recipe has included licenses: %s' % ', '.join(reason)
+            else:
+                return False, 'recipe does not include a copyleft license'
         else:
             return False, 'recipe has excluded licenses: %s' % ', '.join(reason)