[OE-core] [PATCH 2/2] archiver.bbclass: leverage variable typing support

Chris Larson kergoth at gmail.com
Thu May 10 05:05:09 UTC 2012


On Wed, May 9, 2012 at 10:03 PM, Saul Wold <sgw at linux.intel.com> wrote:
> On 05/09/2012 07:40 PM, Christopher Larson wrote:
>>
>> From: Christopher Larson<chris_larson at mentor.com>
>>
>> This makes use of variable typing to avoid reinventing the wheel in that
>> way
>> and adds default values for a couple of said variables. It also changes
>> PATCHES_ARCHIVE_WITH_SERIES to use ?= rather than =.
>>
>> Further, doing this fixes a single bug that occurs in many places:
>>
>>     if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() not in
>> 'SRPM':
>>
>> This is performing a substring search. It should have done "== 'SRPM'"",
>> or if
>> there *were* multiple options for that case (there aren't), it would do
>> "not
>> in ['SRPM']" or similar.
>>
>> Signed-off-by: Christopher Larson<chris_larson at mentor.com>
>> ---
>>  meta/classes/archiver.bbclass    |   45
>> +++++++++++++++++--------------------
>>  meta/classes/package_rpm.bbclass |   12 +++++-----
>>  2 files changed, 27 insertions(+), 30 deletions(-)
>>
>> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
>> index 59b58f4..844dbf8 100644
>> --- a/meta/classes/archiver.bbclass
>> +++ b/meta/classes/archiver.bbclass
>> @@ -2,10 +2,19 @@
>>  # It also output building environment to xxx.dump.data and create
>> xxx.diff.gz to record
>>  # all content in ${S} to a diff file.
>>
>> -ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache"
>> -ARCHIVE_TYPE ?= "TAR SRPM"
>>  DISTRO ?= "poky"
>> -PATCHES_ARCHIVE_WITH_SERIES = 'TRUE'
>> +ARCHIVE_EXCLUDE_FROM ?= ".pc autom4te.cache"
>> +
>> +PATCHES_ARCHIVE_WITH_SERIES ?= "true"
>> +PATCHES_ARCHIVE_WITH_SERIES[type] = "boolean"
>> +
>> +SOURCE_ARCHIVE_PACKAGE_TYPE ?= "tar"
>> +SOURCE_ARCHIVE_PACKAGE_TYPE[type] = "choice"
>> +SOURCE_ARCHIVE_PACKAGE_TYPE[choices] = "tar srpm"
>> +
>
>
> Great patch! But:
>
> Moving this here results in the following error if archiver.bbclass is not
> inherit'ed by default!
>
> ERROR: SOURCE_ARCHIVE_PACKAGE_TYPE: No type specified. Valid types: regex,
> float, list, choice, boolean, integer

Ah! Doh, I didn't think about that -- we really need to fix the
package_rpm code there to not depend on archiver.bbclass specifics.
I'll rework the patch. Thanks.
-- 
Christopher Larson




More information about the Openembedded-core mailing list