<?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>9499</bug_id>
          
          <creation_ts>2016-04-21 11:46:22 +0000</creation_ts>
          <short_desc>license.bbclass find_license_files does not process LICENSE_pn variables correctly</short_desc>
          <delta_ts>2016-08-26 07:00:50 +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>deployment</component>
          <version>2.0</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>2.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ola Nilsson">ola.x.nilsson</reporter>
          <assigned_to name="Markus Lehtonen">markus.lehtonen</assigned_to>
          <cc>elizabeth.flanagan</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>61490</commentid>
    <comment_count>0</comment_count>
    <who name="Ola Nilsson">ola.x.nilsson</who>
    <bug_when>2016-04-21 11:46:22 +0000</bug_when>
    <thetext>The first loop in find_license_files seems to have a few issues

* d.getVar(&apos;PACKAGES&apos;, True) needs a .split() at the end for the loop to process packages instead of letters.

* The assignment to license_types in the loop will add a leading &apos; &amp; &apos; before the first license which will trigger a SyntaxError exception from FindVisitor.visit_string later in the function.

The function does not seem to handle _both_ a LICENSE variable and LICENSE_pn variables.  I could not find any documentation regarding this so I&apos;m not sure what should be supported.  Our recipe was using LICENSE=&quot;MIT&quot; and then the LICENSE_pn variables were using other licenses - not MIT.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62287</commentid>
    <comment_count>1</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-05-18 12:49:52 +0000</bug_when>
    <thetext>Hmm, interesting that this seems to have been broken for years (actually always, from the very beginning, if I read the history correctly) without nobody noticing.

I don&apos;t (yet) know how this is supposed to be working, either. You&apos;re supposed to have something in LICENSE anyway (not defining it fails to build). What is the additional value of having LICENSE_pn instead of just listing them in LICENSE, and, if we want to support those, how LICENSE and LICENSE_pn should be combined. Just concatenate, I suppose(?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62289</commentid>
    <comment_count>2</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-05-18 12:51:39 +0000</bug_when>
    <thetext>Hmm, interesting that this seems to have been broken for years (actually always, from the very beginning, if I read the history correctly) without nobody noticing.

I don&apos;t (yet) know how this is supposed to be working, either. You&apos;re supposed to have something in LICENSE anyway (not defining it fails to build). What is the additional value of having LICENSE_pn instead of just listing them in LICENSE, and, if we want to support those, how LICENSE and LICENSE_pn should be combined. Just concatenate, I suppose(?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62290</commentid>
    <comment_count>3</comment_count>
    <who name="Beth Flanagan">elizabeth.flanagan</who>
    <bug_when>2016-05-18 13:12:41 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; The first loop in find_license_files seems to have a few issues
&gt; 
&gt; * d.getVar(&apos;PACKAGES&apos;, True) needs a .split() at the end for the loop to
&gt; process packages instead of letters.
&gt; 
&gt; * The assignment to license_types in the loop will add a leading &apos; &amp; &apos;
&gt; before the first license which will trigger a SyntaxError exception from
&gt; FindVisitor.visit_string later in the function.
&gt; 
&gt; The function does not seem to handle _both_ a LICENSE variable and
&gt; LICENSE_pn variables.  I could not find any documentation regarding this so
&gt; I&apos;m not sure what should be supported.  Our recipe was using LICENSE=&quot;MIT&quot;
&gt; and then the LICENSE_pn variables were using other licenses - not MIT.

So, LICENSE should contain all the licenses for all the packages for that recipe whereas LICENSE_pn should be the finer grained license for the specific packages. You wouldn&apos;t have LICENSE_pn have say, GPL-2.0 without having that in LICENSE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62291</commentid>
    <comment_count>4</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-05-18 13:21:48 +0000</bug_when>
    <thetext>If license is supposed to contain all LICENSE_pn values then we could just drop the for loop iterating over LICENSE_pn, right(?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62292</commentid>
    <comment_count>5</comment_count>
    <who name="Ola Nilsson">ola.x.nilsson</who>
    <bug_when>2016-05-18 13:40:54 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #0)
&gt; &gt; The first loop in find_license_files seems to have a few issues
&gt; &gt; 
&gt; &gt; * d.getVar(&apos;PACKAGES&apos;, True) needs a .split() at the end for the loop to
&gt; &gt; process packages instead of letters.
&gt; &gt; 
&gt; &gt; * The assignment to license_types in the loop will add a leading &apos; &amp; &apos;
&gt; &gt; before the first license which will trigger a SyntaxError exception from
&gt; &gt; FindVisitor.visit_string later in the function.
&gt; &gt; 
&gt; &gt; The function does not seem to handle _both_ a LICENSE variable and
&gt; &gt; LICENSE_pn variables.  I could not find any documentation regarding this so
&gt; &gt; I&apos;m not sure what should be supported.  Our recipe was using LICENSE=&quot;MIT&quot;
&gt; &gt; and then the LICENSE_pn variables were using other licenses - not MIT.
&gt; 
&gt; So, LICENSE should contain all the licenses for all the packages for that
&gt; recipe whereas LICENSE_pn should be the finer grained license for the
&gt; specific packages. You wouldn&apos;t have LICENSE_pn have say, GPL-2.0 without
&gt; having that in LICENSE.

This makes perfect sense to me, but a better error message would be nice.

I was writing a recipe for an external toolchain, and was basing it on the linaro external toolchain recipe. 

That recipe only sets LICENSE to MIT and then in a comment specifies that this is only the license for the recipe.  When I looked at the resulting .spec-file I realised that the license information of the various packages were wrong.  I then set LICENSE for each package separately based on the package content.  This worked on Dizzy, but when we upgraded to Jethro there was a lot of warnings for the licenses, which lead me to this code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64831</commentid>
    <comment_count>6</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-08-03 13:51:19 +0000</bug_when>
    <thetext>Re-sent the patch and added a patch for LICENSE_&lt;pkg&gt; verification:
https://patchwork.openembedded.org/series/1095/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65546</commentid>
    <comment_count>7</comment_count>
    <who name="Markus Lehtonen">markus.lehtonen</who>
    <bug_when>2016-08-26 07:00:50 +0000</bug_when>
    <thetext>Fix merged in master:
http://git.openembedded.org/openembedded-core/commit/?id=d7229489c7dfd35164fd107d7944f3c273776118</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>