Patchwork [1/1] archiver.bbclass: Add default set

login
register
mail settings
Submitter Xiaofeng Yan
Date May 11, 2012, 10:13 a.m.
Message ID <cc7ee9609296b3a90147287817a0043da45b0c64.1336727342.git.xiaofeng.yan@windriver.com>
Download mbox | patch
Permalink /patch/27463/
State New
Headers show

Comments

Xiaofeng Yan - May 11, 2012, 10:13 a.m.
From: Xiaofeng Yan <xiaofeng.yan@windriver.com>

Add two default set(SOURCE_ARCHIVE_LOG_WITH_SCRIPTS, \
SOURCE_ARCHIVE_PACKAGE_TYPE) to archiver.bbclass for avoiding \
building error when forgetting to assign to them.

Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
---
 meta/classes/archiver.bbclass |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Chris Larson - May 11, 2012, 2:14 p.m.
On Fri, May 11, 2012 at 3:13 AM,  <xiaofeng.yan@windriver.com> wrote:
> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
> index 59b58f4..a720db2 100644
> --- a/meta/classes/archiver.bbclass
> +++ b/meta/classes/archiver.bbclass
> @@ -6,6 +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'
> +export SOURCE_ARCHIVE_LOG_WITH_SCRIPTS
> +export SOURCE_ARCHIVE_PACKAGE_TYPE

I don't think you understand what 'export' does or why it exists.
Please fix that, and remove these lines. Thanks.
Xiaofeng Yan - May 14, 2012, 7:54 a.m.
On 2012?05?11? 22:14, Chris Larson wrote:
> On Fri, May 11, 2012 at 3:13 AM,<xiaofeng.yan@windriver.com>  wrote:
>> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
>> index 59b58f4..a720db2 100644
>> --- a/meta/classes/archiver.bbclass
>> +++ b/meta/classes/archiver.bbclass
>> @@ -6,6 +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'
>> +export SOURCE_ARCHIVE_LOG_WITH_SCRIPTS
>> +export SOURCE_ARCHIVE_PACKAGE_TYPE
> I don't think you understand what 'export' does or why it exists.
> Please fix that, and remove these lines. Thanks.
Hi Chris Larson,
      Thanks for your review. I am testing this according to your 
suggestion and put it to OE-core after test.

Thanks
Yan

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 59b58f4..a720db2 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -6,6 +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'
+export SOURCE_ARCHIVE_LOG_WITH_SCRIPTS
+export SOURCE_ARCHIVE_PACKAGE_TYPE
 
 def get_bb_inc(d):
 	'''create a directory "script-logs" including .bb and .inc file in ${WORKDIR}'''
@@ -277,7 +281,7 @@  def get_package(d):
 	try:
 		f = open(tarpackage,'r')
 		line = list(set(f.readline().replace('\n','').split()))
-	except IOError:
+	except UnboundLocalError,IOError:
 		pass
 	f.close()
 	return line