Skip to contentSkip to conversation

archiver.bbclass: fix copyleft filter behavior

PATCH New Kevin Strasser 1 participant 2 messages Jan 24, 2013

lore
Share & tools
lore
#0 lore raw

cover archiver.bbclass: fix copyleft filter behavior

The following changes since commit 2e2a91025ca9c113365c810ce08b48201fe792b8:

systemd: Fix build on ppc (2013-01-24 20:08:00 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib strassek/archiver_copyleft_filter
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=strassek/archiver_copyleft_filter

Kevin Strasser (1):
archvier.bbclass: fix copyleft filter behavior

 meta/classes/archiver.bbclass |    6 ++++--
 meta/lib/oe/license.py        |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 archvier.bbclass: fix copyleft filter behavior

copyleft_should_include() was only filtering out recipes that contain a license in COPYLEFT_LICENSE_EXCLUDE. This change adds the requirement that the recipe contain a copyleft license, as defined by COPYLEFT_LICENSE_INCLUDE.

Also, filtering results were being mistakenly negated in tar_filter().

---
 meta/classes/archiver.bbclass |    6 ++++--
 meta/lib/oe/license.py        |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
meta/classes/archiver.bbclass +4 -2
index a4a2158..7fd4f0f 100644
@@ -64,8 +64,10 @@ def copyleft_should_include(d):
     else:
         if is_included:
             return True, 'recipe has included licenses: %s' % ', '.join(reason)
-        else:
+        elif reason:
             return False, 'recipe has excluded licenses: %s' % ', '.join(reason)
+        else:
+            return False, 'recipe has neither included nor excluded licenses'
 
 def tar_filter(d):
     """
@@ -75,7 +77,7 @@ def tar_filter(d):
     """
     if d.getVar('FILTER', True) == "yes":
         included, reason = copyleft_should_include(d)
-        if not included:
+        if included:
             return False
         else:
             return True
meta/lib/oe/license.py +3 -1
index 173e319..fc15e9e 100644
@@ -112,5 +112,7 @@ def is_included(licensestr, whitelist=None, blacklist=None):
     included = filter(lambda lic: include_license(lic), licenses)
     if excluded:
         return False, excluded
-    else:
+    elif included:
         return True, included
+    else:
+        return False, None
Signature · 1 line
1.7.9.5