Patchwork [for-dylan,2/2] package.bbclass: ensure license excluded files aren't packaged

login
register
mail settings
Submitter Christopher Larson
Date April 18, 2013, 11:51 p.m.
Message ID <1366329085-11756-2-git-send-email-kergoth@gmail.com>
Download mbox | patch
Permalink /patch/48543/
State Accepted
Commit c045bfe6b991006ac80f0e2d06a8917ae58d9262
Headers show

Comments

Christopher Larson - April 18, 2013, 11:51 p.m.
From: Christopher Larson <chris_larson@mentor.com>

An excluded package left its files behind, which meant they could end up in
another package instead, meaning we could ship GPLv3 binaries even with GPLv3
in INCOMPATIBLE_LICENSE. Skip the files belonging to the excluded packages to
prevent this from occurring.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 meta/classes/package.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 5524816..1a8da40 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -925,7 +925,7 @@  python populate_packages () {
     for pkg in packages.split():
         if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
             bb.warn("%s has an incompatible license. Excluding from packaging." % pkg)
-        elif pkg in package_list:
+        if pkg in package_list:
             bb.error("%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg)
         else:
             package_list.append(pkg)
@@ -965,6 +965,9 @@  python populate_packages () {
                 continue
             seen.append(file)
 
+            if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
+                continue
+
             def mkdir(src, dest, p):
                 src = os.path.join(src, p)
                 dest = os.path.join(dest, p)