All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE
@ 2019-06-06 15:09 Quentin Schulz
  2019-06-08  4:09 ` ✗ patchtest: failure for meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE (rev2) Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Quentin Schulz @ 2019-06-06 15:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: Quentin Schulz, andriy.danylovskyy, bunk

A non-SPDX license (which is not an alias to an SPDX license) cannot
currently be marked as incompatible in INCOMPATIBLE_LICENSE.
In the current state, we take all INCOMPATIBLE_LICENSE and pass them
through expand_wildcard_licenses which is only adding SPDX licenses that
match the glob regexp of what is in INCOMPATIBLE_LICENSE (be it a direct
match to an SPDX license or via an alias).

This does not work well with custom licenses.

E.g.:

foo.bb:
LICENSE = "FooLicense"

conf/local.conf:
INCOMPATIBLE_LICENSE = "FooLicense"

`bitbake foo`

Gives no warning, no error, builds and packages successfully, because
INCOMPATIBLE_LICENSE is basically empty since FooLicense is neither in
SPDXLICENSEMAP nor in SRC_DISTRIBUTE_LICENSES.

Let's add the original licenses to the list returned by
expand_wildcard_licenses to be able to handle the aforementioned case.

INCOMPATIBLE_LICENSE = "FooLicense GPLv2 GPLv3+" used to "resolve" to
"GPLv2 GPLv3". It now resolves to "FooLicense GPLv2 GPLv3 GPLv3+" which
fixes the issue with custom licenses not being in SPDXLICENSEMAP or
SRC_DISTRIBUTE_LICENSES and thus being left out of the blacklisted
licenses.

I needed to pass a list to expand_wildcard_licenses from the
license_image class instead of the current output of map() because the
operator [:] does not work on this kind of type, and list(map()) or
anything that iterates over map() actually moves the iterator and breaks
the forloop right after in expand_wildcard_licenses.

Signed-off-by: Quentin Schulz <quentin.schulz@streamunlimited.com>
---

v2:
  - fixed image building by replacing map(lambda) by a comprehensive list so
that we have a consistent input type for expand_wildcard_licenses,

 meta/classes/license.bbclass       | 2 +-
 meta/classes/license_image.bbclass | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index aec6999d9d..3e029038ab 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -268,7 +268,7 @@ def expand_wildcard_licenses(d, wildcard_licenses):
     wildcards from SPDXLICENSEMAP flags and SRC_DISTRIBUTE_LICENSES values.
     """
     import fnmatch
-    licenses = []
+    licenses = wildcard_licenses[:]
     spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys()
     for wld_lic in wildcard_licenses:
         spdxflags = fnmatch.filter(spdxmapkeys, wld_lic)
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass
index b65ff56f7d..9e182f1af1 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -39,7 +39,7 @@ def write_license_files(d, license_manifest, pkg_dic):
     import re
 
     bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split()
-    bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses)
+    bad_licenses = [canonical_license(d, l) for l in bad_licenses]
     bad_licenses = expand_wildcard_licenses(d, bad_licenses)
 
     with open(license_manifest, "w") as license_file:
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* ✗ patchtest: failure for meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE (rev2)
  2019-06-06 15:09 [PATCH v2] meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE Quentin Schulz
@ 2019-06-08  4:09 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2019-06-08  4:09 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: openembedded-core

== Series Details ==

Series: meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE (rev2)
Revision: 2
URL   : https://patchwork.openembedded.org/series/17996/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 666f6192aa)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-08  4:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 15:09 [PATCH v2] meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE Quentin Schulz
2019-06-08  4:09 ` ✗ patchtest: failure for meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.