<?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>1561</bug_id>
          
          <creation_ts>2011-10-03 07:13:38 +0000</creation_ts>
          <short_desc>Enable cleanup of WORKDIR</short_desc>
          <delta_ts>2012-03-22 04:10: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>Meta-yocto</product>
          <component>meta-yocto</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>(P3)(QA testing completed) Done</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Kai Kang">kai.kang</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>liang.li2</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</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>16609</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2011-10-03 07:13:38 +0000</bug_when>
    <thetext>Currently, old versions of recipes can be left lying around the in WORKDIR. We could have a script that could go through and prune out old versions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18608</commentid>
    <comment_count>1</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-02-13 17:57:53 +0000</bug_when>
    <thetext>      Rough design document for cleanup of WORKDIR

* Purpose

This feature is from Yocto 1.2 Bug 1651.
Currently, old versions of recipes can be left lying around the in WORKDIR. We
could have a script that could go through and prune out old versions.

Name it with bitbake-cleanworkdir, implent with python and put it into directory bitbake/bin

* Usage:
bitbake-cleanworkdir [package-name]

* Design Flow
1 parse the argument. If the package name is provides, just clean the package&apos;s
  old build directory; otherwise clean all packages&apos; the old build directory
2 Just like bitbake-runtask, construct a bitbake cooker then get current version(s)
  of giving package or every package, similar with &apos;bitbake -s&apos;
3 walk the WORKDIR and clean the old version directory</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18845</commentid>
    <comment_count>2</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-03-02 09:01:41 +0000</bug_when>
    <thetext>Implement in another way by adding a option to bitbake, because the original design doesn&apos;t work</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18846</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-03-02 12:23:17 +0000</bug_when>
    <thetext>Please try and do this by calling into bitbake and obtaining the appropriate information from an external script rather than patch bitbake itself.

If you have to patch bitbake itself, that means teaching bitbake &quot;internal&quot; knowledge about the metadata layout and breaks our APIs. Such a patch is likely not going to be acceptable (bitbake knows nothing directly about WORKDIR, nor should it).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18859</commentid>
    <comment_count>4</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-03-05 02:32:20 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Please try and do this by calling into bitbake and obtaining the appropriate
&gt; information from an external script rather than patch bitbake itself.
&gt; 
&gt; If you have to patch bitbake itself, that means teaching bitbake &quot;internal&quot;
&gt; knowledge about the metadata layout and breaks our APIs. Such a patch is likely
&gt; not going to be acceptable (bitbake knows nothing directly about WORKDIR, nor
&gt; should it).

OK. I&apos;ll try to send another patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18871</commentid>
    <comment_count>5</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-03-06 07:30:23 +0000</bug_when>
    <thetext>Sent the patch as external script for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19320</commentid>
    <comment_count>6</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-03-22 02:04:36 +0000</bug_when>
    <thetext>Patch is merged</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19324</commentid>
    <comment_count>7</comment_count>
    <who name="liang li">liang.li2</who>
    <bug_when>2012-03-22 04:10:07 +0000</bug_when>
    <thetext>verified on :
git info:047ce547edd61b0d3b15c22b3492f7595ce2bc66
git branch:master

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

test steps below:
1. set build env,run &quot;soruce ./oe-init-build-env builddir&quot;.
2. In builddir,run &quot;bitbake gzip&quot; (MACHINE ?= &quot;mpc8315e-rdb&quot; in local.conf).
3. In builddir,run &quot;bitbake -b path_to_git/meta/recipes-extended/gzip/gzip_1.3.12.bb&quot;.
4. run &quot;path_to_git/scripts/cleanup-workdir&quot;.

results below:

output from screen :
Updating bitbake caches...
......
Deleleting path_to_git/tmp/work/powerpc-poky-linux/gzip-1.3.12-r0
......
Total 80 items.

only &quot;gzip-1.4-r1&quot; dir exists in tmp/work/powerpc-poky-linux after step 4,which is the version currently used by bitbake.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>