<?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>2473</bug_id>
          
          <creation_ts>2012-05-18 15:27:44 +0000</creation_ts>
          <short_desc>Create or modify class for license filtered source archival using archiver.bbclass</short_desc>
          <delta_ts>2012-07-05 10:20:55 +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>Other YP Layers</product>
          <component>layers</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(QA testing completed) Done</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christopher Larson">kergoth</reporter>
          <assigned_to name="Xiaofeng Yan">Xiaofeng.yan</assigned_to>
          <cc>kai.kang</cc>
    
    <cc>liang.li2</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>meta.layer.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>song.liu</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21454</commentid>
    <comment_count>0</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2012-05-18 15:27:44 +0000</bug_when>
    <thetext>The current copyleft_compliance class does this, but doesn&apos;t leverage the new shared archiver.bbclass functionality. We should consider adapting it to do so, or creating another archive- class to do so. The oe.license python module does most of the work for this, so it would likely be a fairly small effort, but would reduce some duplication.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21539</commentid>
    <comment_count>1</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-05-23 01:44:18 +0000</bug_when>
    <thetext>Hi Christopher Larson,

Thanks your suggestion. I will learn these class and apply them in archiver.bbclass.

Thanks
Yan</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21973</commentid>
    <comment_count>2</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-06-11 05:44:35 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=9a519998f4e64dc067882c9fcd4416db49fccccd</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22523</commentid>
    <comment_count>3</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-06-25 03:56:55 +0000</bug_when>
    <thetext>add following to conf/local.conf:

INHERIT += &quot;archive-original-source&quot;
SOURCE_ARCHIVE_PACKAGE_TYPE ?= &apos;srpm&apos; 
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= &apos;logs_with_scripts&apos;
run &quot;bitbake core-image-sato&quot;,no error happend during build process.

git info: e0a70547069fe7e8a2d6bdaffc985fb172d46c31
git branch: poky/master

test env:
host:ubuntu 12.04 x86_64
linux kernel:3.2.0-25-generic #40-Ubuntu SMP</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22524</commentid>
    <comment_count>4</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2012-06-25 04:05:59 +0000</bug_when>
    <thetext>This is not done. You&apos;ve misunderstood what the bug requested. copyleft_compliance allows you to specify, by license, which recipes should and which should not get their sources distributed. As far as I know, archiver.bbclass still does not provide this filtering mechanism.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22525</commentid>
    <comment_count>5</comment_count>
    <who name="Christopher Larson">kergoth</who>
    <bug_when>2012-06-25 04:08:02 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; This is not done. You&apos;ve misunderstood what the bug requested.
&gt; copyleft_compliance allows you to specify, by license, which recipes should
&gt; and which should not get their sources distributed. As far as I know,
&gt; archiver.bbclass still does not provide this filtering mechanism.

Further, is_included is being misused. This function is used to determine whether a license matches inclusion/exclusion patterns. It is *not* a function to get a list of all licenses used by a recipe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22533</commentid>
    <comment_count>6</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-06-25 09:06:55 +0000</bug_when>
    <thetext>sorry to misunderstand your idea. According to your idea we should add an option for archiver.bbclass usage. 

ARCHIVER_MODE ?= &quot;original&quot;
ARCHIVER_MODE[type] ?= &quot;tar&quot;
ARCHIVER_MODE[log_type] ?= &quot;logs_with_scripts&quot;
ARCHIVER_MODE[filter] = &quot;no&quot;  # we should add this. Do you agree with me ?
ARCHIVER_CLASS = &quot;${@&apos;archive-${ARCHIVER_MODE}-source&apos; if ARCHIVER_MODE != &apos;none&apos; else &apos;&apos;}&quot;
INHERIT += &quot;${ARCHIVER_CLASS}&quot; 


Please review comment with &quot;#&quot;.  &quot;no&quot; represent using original mehod. &quot;yes&quot; represent using filter mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22538</commentid>
    <comment_count>7</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-06-25 11:02:50 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; This is not done. You&apos;ve misunderstood what the bug requested.
&gt; &gt; copyleft_compliance allows you to specify, by license, which recipes should
&gt; &gt; and which should not get their sources distributed. As far as I know,
&gt; &gt; archiver.bbclass still does not provide this filtering mechanism.
&gt; 
&gt; Further, is_included is being misused. This function is used to determine
&gt; whether a license matches inclusion/exclusion patterns. It is *not* a
&gt; function to get a list of all licenses used by a recipe.

 is_included(licensestr, whitelist=None, blacklist=None)

is_included can return right result in the status of default set.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22685</commentid>
    <comment_count>8</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-06-29 02:08:17 +0000</bug_when>
    <thetext>Yocto commit c3d8b100a2d98770aa977555f11dc70de0a2e1d4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22830</commentid>
    <comment_count>9</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-07-05 10:20:55 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; Yocto commit c3d8b100a2d98770aa977555f11dc70de0a2e1d4

I tried adding the two configurations separately to conf/local.conf as below:
---------------------------
CONF_VERSION = &quot;1&quot;
ARCHIVER_MODE ?= &quot;original&quot;
ARCHIVER_MODE[type] ?= &quot;tar&quot;
ARCHIVER_MODE[log_type] ?= &quot;logs_with_scripts&quot;
ARCHIVER_CLASS = &quot;${@&apos;archive-${ARCHIVER_MODE}-source&apos; if ARCHIVER_MODE != &apos;none&apos; else &apos;&apos;}&quot;
INHERIT += &quot;${ARCHIVER_CLASS}&quot;
---------------------------
and 
---------------------------
CONF_VERSION = &quot;1&quot;
ARCHIVER_MODE ?= &quot;original&quot;
ARCHIVER_MODE[type] ?= &quot;tar&quot;
ARCHIVER_MODE[log_type] ?= &quot;logs_with_scripts&quot;
ARCHIVER_MODE[filter] = &quot;yes&quot;
ARCHIVER_CLASS = &quot;${@&apos;archive-${ARCHIVER_MODE}-source&apos; if ARCHIVER_MODE != &apos;none&apos; else &apos;&apos;}&quot;
INHERIT += &quot;${ARCHIVER_CLASS}&quot;
----------------------------

then run &quot;bitbake core-image-minimal&quot; ,no error happend during build process.

using the first configurations, following are found in &quot;tmp/deploy/sources&quot; dir:
[yocto@yocto-linux powerpc-poky-linux]$ pwd
/buildarea/tester/build_23/tmp/deploy/sources/powerpc-poky-linux
[yocto@yocto-linux powerpc-poky-linux]$ ls
BSD-3-Clause         GPL-3.0-with-GCC-exceptionGPL-3.0  LGPLv2+BSDPD
GPL-1.0              GPLv2+                             MIT
GPL-2.0              GPLv2.0+LGPLv2.1+                  PD
GPL-2.0BSD-4-Clause  GPLv3+                             Sleepycat
GPL-2.0+LGPL-2.1+    GPLv3+LGPL-2.1+                    Zlib
GPL-2.0LGPL-2.1      LGPLv2.1+
GPL-3.0              LGPLv2.1+GPLv2+


using the second configurations, following are found in &quot;tmp/deploy/sources&quot; dir:
[yocto@yocto-linux powerpc-poky-linux]$ pwd
/buildarea/tester/build_21/tmp/deploy/sources/powerpc-poky-linux
[yocto@yocto-linux powerpc-poky-linux]$ ls
GPL-2.0  GPL-3.0
[yocto@yocto-linux powerpc-poky-linux]$

--------------------------
verified info:
git info: 3051f3644496ab570f3c6fb8f5def9d5843b1508
git branch: poky/master

test env:
host:Fedora 17 x86_64
linux kernel:3.4.3-1.fc17.x86_64 #1 SMP</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>