meta-oe/meta-perl is showing some errors with some perl recipes that are not getting parsed correctly because there are no spaces between the license and the "op" (|, &). ERROR: libdigest-hmac-perl-1.03-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libipc-signal-perl-1.00-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libmime-types-perl-2.17-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libproc-waitstat-perl-1.00-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libdigest-sha1-perl-2.13-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libxml-libxml-perl-2.0134-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libnet-telnet-perl-3.05-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libio-socket-ssl-perl-2.074-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libauthen-sasl-perl-2.16-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later ERROR: libnet-ldap-perl-0.68-r0 do_create_spdx: Cannot find any text for license Artistic-1.0|GPL-1.0-or-later We should extend the license parser to understand this correctly
Hello ! It's possible for me to work on this
I could not find any relation to "&" and "|" operators in the SPDX specifications. As they are use as shortcuts to "AND" and "OR", I would say spaces are required. Note that recipes have been updated and now have spaces around the operators. As the specification does not accept '&' and '|' in the identifier, it is possible to treat them as operators. Do we want that ?
Not quite sure what you mean by "operators"? The LICENSE field isn't _exactly_ an SPDX license string because it was developed indepndently and uses it's own syntax (& and |). However, it does accept SPDX license identifier names for the licenses, since this is a standardized way to enumerate licenses and saves us some of the trouble of enumerating them ourselves. The code to convert OE license strings to SPDX licenes strings is pretty dumb and can't handle spaces, which is more or less the problem being described here. Either A) create-spdx.bbclass license parsing should get smarter to handle spaces, B) spaces should no longer be allowed elsewhere in the license code to match create-spdx.bbclass (otherwise, the licenses _only_ fail when SPDX is enabled, or C) LICENSE should be defined as the SPDX license string, dropping support for & and | in favor of AND, OR, et. al. C) is probably the least likely since it's a pretty major breaking change, A) is probably the most expedient.
I have pushed a patch https://lore.kernel.org/all/20230525-spdx-parse-license-v1-1-c5e1f6218487@baylibre.com/
Fixed in https://git.openembedded.org/openembedded-core/commit/?h=master-next&id=28c704bdf731f1c5012b74e4fdb899622f15a7b1