<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14890</bug_id>
          
          <creation_ts>2022-08-16 15:34:23 +0000</creation_ts>
          <short_desc>create-spdx should parse license strings with and without spaces between license terms</short_desc>
          <delta_ts>2023-06-12 12:55:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Saul Wold">saul.wold</reporter>
          <assigned_to name="Joshua Watt">JPEWhacker</assigned_to>
          <cc>JPEWhacker</cc>
    
    <cc>louis.rannou</cc>
    
    <cc>raj.khem</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>93800</commentid>
    <comment_count>0</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2022-08-16 15:34:23 +0000</bug_when>
    <thetext>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 &quot;op&quot; (|, &amp;).

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95501</commentid>
    <comment_count>1</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-05-05 11:55:43 +0000</bug_when>
    <thetext>Hello ! It&apos;s possible for me to work on this</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95506</commentid>
    <comment_count>2</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-05-09 13:29:59 +0000</bug_when>
    <thetext>I could not find any relation to &quot;&amp;&quot; and &quot;|&quot; operators in the SPDX specifications. As they are use as shortcuts to &quot;AND&quot; and &quot;OR&quot;, 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 &apos;&amp;&apos; and &apos;|&apos; in the identifier, it is possible to treat them as operators.

Do we want that ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95584</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Watt">JPEWhacker</who>
    <bug_when>2023-05-23 16:52:11 +0000</bug_when>
    <thetext>Not quite sure what you mean by &quot;operators&quot;? The LICENSE field isn&apos;t _exactly_ an SPDX license string because it was developed indepndently and uses it&apos;s own syntax (&amp; 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&apos;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 &amp; and | in favor of AND, OR, et. al.

C) is probably the least likely since it&apos;s a pretty major breaking change, A) is probably the most expedient.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95608</commentid>
    <comment_count>4</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-06-01 09:10:24 +0000</bug_when>
    <thetext>I have pushed a patch https://lore.kernel.org/all/20230525-spdx-parse-license-v1-1-c5e1f6218487@baylibre.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95703</commentid>
    <comment_count>5</comment_count>
    <who name="Louis Rannou">louis.rannou</who>
    <bug_when>2023-06-12 12:55:07 +0000</bug_when>
    <thetext>Fixed in https://git.openembedded.org/openembedded-core/commit/?h=master-next&amp;id=28c704bdf731f1c5012b74e4fdb899622f15a7b1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>