archiver.bbclass: Improve the usability for the archiver classes
authorXiaofeng Yan <xiaofeng.yan@windriver.com>
Wed, 30 May 2012 09:03:56 +0000 (17:03 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jun 2012 21:56:32 +0000 (22:56 +0100)
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.

[YOCTO #2472]

(From OE-Core rev: ce91f495e0c4ef3bf53ee8b2ea570061da38e14f)

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/archiver.bbclass

index 67eac84..ed2dbe4 100644 (file)
@@ -6,8 +6,10 @@ ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache"
 ARCHIVE_TYPE ?= "TAR SRPM"
 DISTRO ?= "poky"
 PATCHES_ARCHIVE_WITH_SERIES = 'TRUE'
-SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'logs_with_scripts'
-SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'tar'
+SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= '${@d.getVarFlag('ARCHIVER_MODE', 'log_type') \
+                                    if d.getVarFlag('ARCHIVER_MODE', 'log_type') != 'none' else 'logs_with_scripts'}'
+SOURCE_ARCHIVE_PACKAGE_TYPE ?= '${@d.getVarFlag('ARCHIVER_MODE','type') \
+                                 if d.getVarFlag('ARCHIVER_MODE', 'log_type')!= 'none' else 'tar'}'
 
 def get_bb_inc(d):
        '''create a directory "script-logs" including .bb and .inc file in ${WORKDIR}'''