]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
spdx: Fix license parsing
authorLouis Rannou <lrannou@baylibre.com>
Thu, 25 May 2023 08:53:23 +0000 (10:53 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 31 May 2023 15:52:42 +0000 (16:52 +0100)
[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 <lrannou@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/create-spdx-2.2.bbclass

index 13d13fe1fcf4870b4410fc98b625b84388422a15..e0f62a43a2d670c14992c9d32622f44e46bb4c83 100644 (file)
@@ -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)