Return-Path: Received: from bsmtp7.bon.at (bsmtp7.bon.at [213.33.87.19]) by mail.openembedded.org (Postfix) with ESMTP id 6CBD67D3E0 for ; Wed, 5 Jun 2019 15:24:06 +0000 (UTC) Received: from qschulz.sue.net (vpn.streamunlimited.com [91.114.0.140]) by bsmtp7.bon.at (Postfix) with ESMTPSA id 45Jsyb3G8jz5tlJ; Wed, 5 Jun 2019 17:24:07 +0200 (CEST) From: Quentin Schulz To: openembedded-core@lists.openembedded.org Date: Wed, 5 Jun 2019 17:23:52 +0200 Message-Id: <20190605152352.25846-1-quentin.schulz@streamunlimited.com> X-Mailer: git-send-email 2.17.1 Cc: Quentin Schulz , andriy.danylovskyy@streamunlimited.com Subject: [PATCH] meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 15:24:07 -0000 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. Signed-off-by: Quentin Schulz --- meta/classes/license.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index ed91a4b4db..adca881c85 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) -- 2.17.1