diff options
| author | Louis Rannou <lrannou@baylibre.com> | 2023-05-25 10:53:23 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-31 16:53:04 +0100 |
| commit | beae214a45807ced21c8405a45fec212a4659070 (patch) | |
| tree | 19478162b67e2fa3ad38357ee8a2016985487b7f | |
| parent | de8be85b9abd592bfc828e38b2c5600f74b15fcc (diff) | |
| download | poky-beae214a45807ced21c8405a45fec212a4659070.tar.gz | |
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.
(From OE-Core rev: 28c704bdf731f1c5012b74e4fdb899622f15a7b1)
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>
| -rw-r--r-- | meta/classes/create-spdx-2.2.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass index 13d13fe1fc..e0f62a43a2 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={}): | |||
| 167 | 167 | ||
| 168 | return spdx_license | 168 | return spdx_license |
| 169 | 169 | ||
| 170 | lic_split = lic.replace("(", " ( ").replace(")", " ) ").split() | 170 | lic_split = lic.replace("(", " ( ").replace(")", " ) ").replace("|", " | ").replace("&", " & ").split() |
| 171 | 171 | ||
| 172 | return ' '.join(convert(l) for l in lic_split) | 172 | return ' '.join(convert(l) for l in lic_split) |
| 173 | 173 | ||
