From: Louis Rannou Date: Thu, 25 May 2023 08:53:23 +0000 (+0200) Subject: spdx: Fix license parsing X-Git-Tag: uninative-4.1~624 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28c704bdf731f1c5012b74e4fdb899622f15a7b1;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git spdx: Fix license parsing [YOCTO #14890] -- https://bugzilla.yoctoproject.org/show_bug.cgi?id=14890#c3 Since spaces in the license name are not mandatory, we need to add spaces around `|` and `&` before spliting. Signed-off-by: Louis Rannou Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 13d13fe1fcf..e0f62a43a2d 100644 --- a/meta/classes/create-spdx-2.2.bbclass +++ b/meta/classes/create-spdx-2.2.bbclass @@ -167,7 +167,7 @@ def convert_license_to_spdx(lic, document, d, existing={}): return spdx_license - lic_split = lic.replace("(", " ( ").replace(")", " ) ").split() + lic_split = lic.replace("(", " ( ").replace(")", " ) ").replace("|", " | ").replace("&", " & ").split() return ' '.join(convert(l) for l in lic_split)