Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 4/7] base.bbclass: Simplify the check for whitelisted licenses
Date: Sat,  7 Dec 2019 06:38:12 +0100	[thread overview]
Message-ID: <20191207053815.1757-4-pkj@axis.com> (raw)
In-Reply-To: <20191207053815.1757-1-pkj@axis.com>

After a number of rewrites, the code checking if a package has been
whitelisted for an incompatible license was calculating the
whitelisted packages twice (as 'whitelist' and as 'incompatwl').

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/classes/base.bbclass | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 3306b316bb..5176168cf8 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -531,23 +531,21 @@ python () {
             bad_licenses = expand_wildcard_licenses(d, bad_licenses)
 
             whitelist = []
-            incompatwl = []
             for lic in bad_licenses:
                 spdx_license = return_spdx(d, lic)
                 whitelist.extend((d.getVar("WHITELIST_" + lic) or "").split())
                 if spdx_license:
                     whitelist.extend((d.getVar("WHITELIST_" + spdx_license) or "").split())
+
+            if pn in whitelist:
                 '''
                 We need to track what we are whitelisting and why. If pn is
                 incompatible we need to be able to note that the image that
                 is created may infact contain incompatible licenses despite
                 INCOMPATIBLE_LICENSE being set.
                 '''
-                incompatwl.extend((d.getVar("WHITELIST_" + lic) or "").split())
-                if spdx_license:
-                    incompatwl.extend((d.getVar("WHITELIST_" + spdx_license) or "").split())
-
-            if not pn in whitelist:
+                bb.note("Including %s as buildable despite it having an incompatible license because it has been whitelisted" % pn)
+            else:
                 pkgs = d.getVar('PACKAGES').split()
                 skipped_pkgs = []
                 unskipped_pkgs = []
@@ -567,9 +565,6 @@ python () {
                 elif all_skipped or incompatible_license(d, bad_licenses):
                     bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
                     raise bb.parse.SkipRecipe("it has an incompatible license: %s" % license)
-            elif pn in whitelist:
-                if pn in incompatwl:
-                    bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
 
         # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a
         # superset of all per-package licenses. We do not do advanced (pattern)
-- 
2.21.0



  parent reply	other threads:[~2019-12-07  5:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-07  5:38 [PATCH 1/7] license.bbclass: Introduce AVAILABLE_LICENSES that lists all licenses Peter Kjellerstedt
2019-12-07  5:38 ` [PATCH 2/7] licenses.conf: Remove the SRC_DISTRIBUTE_LICENSES variable Peter Kjellerstedt
2019-12-07  5:38 ` [PATCH 3/7] license.bbclass: Make incompatible_pkg_license return incompatible lics Peter Kjellerstedt
2019-12-07  5:38 ` Peter Kjellerstedt [this message]
2019-12-07  5:38 ` [PATCH 5/7] base.bbclass: Report only the licenses that are incompatible for a package Peter Kjellerstedt
2019-12-09 10:20   ` Quentin Schulz
2019-12-11  1:01     ` Peter Kjellerstedt
2019-12-07  5:38 ` [PATCH 6/7] package.bbclass: Report only the licenses that are incompatible Peter Kjellerstedt
2019-12-07  5:38 ` [PATCH 7/7] license_image.bbclass: " Peter Kjellerstedt
2019-12-09  9:40 ` [PATCH 1/7] license.bbclass: Introduce AVAILABLE_LICENSES that lists all licenses Quentin Schulz
2019-12-11  0:51   ` Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191207053815.1757-4-pkj@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox