Patchwork [1/2] archiver.bbclass: Improve the usability for the archiver classes

login
register
mail settings
Submitter Xiaofeng Yan
Date May 31, 2012, 6:02 a.m.
Message ID <ee86332c73aa80fe35b1d87818edd966a07829b6.1338443711.git.xiaofeng.yan@windriver.com>
Download mbox | patch
Permalink /patch/28977/
State Accepted
Commit ce91f495e0c4ef3bf53ee8b2ea570061da38e14f
Headers show

Comments

Xiaofeng Yan - May 31, 2012, 6:02 a.m.
From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

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]

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
---
 meta/classes/archiver.bbclass |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index ac8aa95..582c565 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -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}'''