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.
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's old build directory; otherwise clean all packages' 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 'bitbake -s' 3 walk the WORKDIR and clean the old version directory
Implement in another way by adding a option to bitbake, because the original design doesn't work
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 "internal" 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).
(In reply to comment #3) > 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 "internal" > 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). OK. I'll try to send another patch.
Sent the patch as external script for review.
Patch is merged
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 "soruce ./oe-init-build-env builddir". 2. In builddir,run "bitbake gzip" (MACHINE ?= "mpc8315e-rdb" in local.conf). 3. In builddir,run "bitbake -b path_to_git/meta/recipes-extended/gzip/gzip_1.3.12.bb". 4. run "path_to_git/scripts/cleanup-workdir". 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 "gzip-1.4-r1" dir exists in tmp/work/powerpc-poky-linux after step 4,which is the version currently used by bitbake.