<?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>1977</bug_id>
          
          <creation_ts>2012-02-09 21:55:07 +0000</creation_ts>
          <short_desc>Realize source archiver class</short_desc>
          <delta_ts>2012-04-02 18:09:33 +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>core</component>
          <version>1.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(P2)(QA testing completed) Done</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xiaofeng Yan">Xiaofeng.yan</reporter>
          <assigned_to name="Xiaofeng Yan">Xiaofeng.yan</assigned_to>
          <cc>david.nystrom</cc>
    
    <cc>dvhart</cc>
    
    <cc>liang.li2</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
    
    <cc>wenzong.fan</cc>
    
    <cc>yi.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>18579</commentid>
    <comment_count>0</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-02-09 21:55:07 +0000</bug_when>
    <thetext>We recently had the 2 different implementation (bug 1590 and 1655) suggested on the list to accomplish WORKDIR archiving along with the existing sourcepkg, distribute_src,copyleft_compliance and other possibly others.
There are two classes (src_distribute.bbclass and sourcepkg.bbclass) which have similar function as bug 1590 and 1655. So for avoiding repetition, We should use a new bb class (archiver.class) to merge same function in the above description instead of four or more bb class.
 
We are trying to tackle include a variety of legal and policy requirements.

This is a progression list of what the source archives should include:

1 - Original Upstream Archive &amp; Patches
    - 2 archives (tarballs)
2 - Original Source code &amp; Patches
    - could include additional code
    - post unpack
    - 1 archive
3 - Original Source code &amp; Patches &amp; temp (scripts &amp; logs)
    - Could possibly include the .bb and .inc files
    - 2 archives (from #2 &amp; temp tarball)
4 - Patched source code
    - original source code could be removed
    - post do_patch
5 - Patched source code &amp; temp
    - 2 archives (from #4 &amp; temp tarball)
6 - Configured Source
    - post do_configure
7 - SRPM format of Original Source &amp; Patches
  - rpm will apply the patches
  - internally contains #2 above
8 - SRPM various of #3 above</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18672</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-02-21 14:04:19 +0000</bug_when>
    <thetext>*** Bug 1655 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18674</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-02-21 14:05:12 +0000</bug_when>
    <thetext>*** Bug 1590 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19098</commentid>
    <comment_count>3</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2012-03-14 18:53:16 +0000</bug_when>
    <thetext>*** Bug 2084 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19498</commentid>
    <comment_count>4</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-03-27 07:53:36 +0000</bug_when>
    <thetext>How to test archiver.bbclass

#Archiving packages configuration#

The following variables lists which files to archive and the package type to archive.
One bbclass of them (archive-original-source.bbclass,archive-configured-source.bbclass) should be inherited in a global bbclass, for example, inherit archive-original-source in packages_rpm.bbclass

Please copy the following parts to local.conf

# SOURCE_ARCHIVE_PACKAGE_TYPE = {&apos;tar&apos;,&apos;srpm&apos;}
SOURCE_ARCHIVE_PACKAGE_TYPE ?= &apos;tar&apos;(or &apos;srpm&apos;)
#
# SOURCE_ARCHIVE_LOG_WITH_SCRIPTS = {&apos;logs_with_scripts&apos;, &apos;logs&apos;}
# String &apos;logs_with_scripts&apos; include temp directory and .bb and .inc files
# String &apos;logs&apos; only include temp 
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= &apos;logs_with_scripts&apos;(or &apos;logs&apos;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19499</commentid>
    <comment_count>5</comment_count>
    <who name="Xiaofeng Yan">Xiaofeng.yan</who>
    <bug_when>2012-03-27 07:56:20 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=dd61d59c47f95a3f9b451f4cc903c5c31621ac0c
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=0cc11b390d1fbd322fd1ce5ed5a9cfea5839f58a
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6dd4ddf7eacc0b71f046a3086d949830918bc4c3
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6a99e0f8fbb5c7a411da2e4b724c43f28e6fa0c1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19543</commentid>
    <comment_count>6</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-03-28 03:09:46 +0000</bug_when>
    <thetext>verified on :
git info :  d3e0beed9eef53018158c9f999cd20b44629aa61 
git branch :poky/master

test env:
host os: ubuntu 11.10 x86_64
kernel : 
3.0.0-16-generic #29-Ubuntu SMP

test steps:
1. add following line to  path_to_git/meta/classes/package_rpm.bbclass
inherit archive-original-source
2. set build env,run &quot;soruce ./oe-init-build-env builddir&quot;.
3. add following lines to conf/local.conf of builddir:
SOURCE_ARCHIVE_PACKAGE_TYPE ?= &apos;srpm&apos;
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= &apos;logs_with_scripts&apos;
4. run &quot;bitbake core-image-sato&quot; (MACHINE ?= &quot;qemuppc&quot; in conf/local.conf).

results below:
1. new subdir &quot;tmp/deploy/sources&quot; be found in builddir.
2. &quot;gzip-1.4-r1.src.rpm&quot; be found in &quot;tmp/deploy/sources/deploy-srpm/ppc603e/GPLv3+/&quot; subdir of builddir.
3. run &quot;rpm -i gzip-1.4-r1.src.rpm&quot; on a qemuppc sato-sdk target,following packages found in dir &quot;/usr/src/rpm/SOURCES&quot;:
gzip-1.4-r1-script-logs.tar.gz
gzip-1.4.tar.gz 
4. extract &quot;gzip-1.4-r1-script-logs.tar.gz&quot; , logs (log.* and run.*) in temp subdir of gzip package in builddir be found,&quot;gzip.inc&quot; and &quot;gzip_1.4.bb&quot; be found.
5. extract &quot;gzip-1.4.tar.gz&quot; ,gzip source code be found.

next test will change status to verified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19579</commentid>
    <comment_count>7</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-03-29 01:49:33 +0000</bug_when>
    <thetext>verified on :
git info :  d3e0beed9eef53018158c9f999cd20b44629aa61 
git branch :poky/master

I also have tried add following lines to path_to_git/meta/classes/package_rpm.bbclass just like discribed in Comment 4:
inherit archive-configured-source.bbclass

and tried add follwing choice in conf/local.conf just like discribed in Comment 4:
SOURCE_ARCHIVE_PACKAGE_TYPE ?= &apos;tar&apos;
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= &apos;logs&apos;

since no error found ,so verify it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>