Bug 2472

Summary: archiver.bbclass: improve usability
Product: [Build System, Metadata & Runtime] Other YP Layers Reporter: Christopher Larson <kergoth>
Component: layersAssignee: Xiaofeng Yan <Xiaofeng.yan>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: liang.li2, liezhi.yang, meta.layer.watcher, meta.watcher, zhenfeng.zhao
Version: unspecified   
Target Milestone: 1.3 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: (QA testing completed) Done
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Christopher Larson 2012-05-18 15:23:33 UTC
In my opinion, the usability of the archiver classes can be improved, beyond the simple addition of default values for the variables. A user could well inherit just archiver rather than the individual useful classes, and not realize it will do nothing.

In my distro, I'm doing something this:

# More sane usability for the archiver classes
ARCHIVER_MODE ?= "none"
ARCHIVER_MODE[type] = "choice"
ARCHIVER_MODE[choices] = "none original patched configured"
ARCHIVER_CLASS = "${@'archive-${ARCHIVER_MODE}-source' \
                     if ARCHIVER_MODE != 'none' else ''}"
INHERIT += "${ARCHIVER_CLASS}"
Comment 1 Xiaofeng Yan 2012-05-23 01:46:28 UTC
Hi Christopher Larson,

This is good way to point to the type for archiving. I will learn your ideas and add them to appropriate place. thanks your good suggestion.

Thanks
Yan
Comment 3 liang li 2012-06-12 10:07:05 UTC
the following is added to the local.conf of build dir:

INHERIT += "archive-original-source"
SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'tar'
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'xxx'

run "bitbake core-image-sato-sdk" in build dir to build the qemuppc core-image-sato-sdk image, then change the above to :

INHERIT += "archive-original-source"
SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'tar'
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= ''
 
run "bitbake core-image-sato-sdk" in build dir to build the qemuppc core-image-sato-sdk image.

no error happened , change status to verified.

test env :
host :ubuntu 11.10 x86_64
kernel :3.0.0-20-generic #34-Ubuntu SMP

git info:60543b931d073e17ad935aacfbd0d4eba76e2360
git branch :poky/master