Patchwork [3/4] strace: replace += with _append for appending to OVERRIDES variables

login
register
mail settings
Submitter Ming Liu
Date Oct. 20, 2013, 10:48 a.m.
Message ID <1382266112-24559-3-git-send-email-ming.liu@windriver.com>
Download mbox | patch
Permalink /patch/60265/
State New
Headers show

Comments

Ming Liu - Oct. 20, 2013, 10:48 a.m.
In some cases, it's unfit to use "+=" in a conditional appending, we would
end up with the variable being set rather than being appended, which is not
it mean to.

Signed-off-by: Ming Liu <ming.liu@windriver.com>
---
 meta/recipes-devtools/strace/strace_4.8.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Martin Jansa - Oct. 20, 2013, 10:59 a.m.
On Sun, Oct 20, 2013 at 06:48:31PM +0800, Ming Liu wrote:
> In some cases, it's unfit to use "+=" in a conditional appending, we would
> end up with the variable being set rather than being appended, which is not
> it mean to.
> 
> Signed-off-by: Ming Liu <ming.liu@windriver.com>
> ---
>  meta/recipes-devtools/strace/strace_4.8.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-devtools/strace/strace_4.8.bb b/meta/recipes-devtools/strace/strace_4.8.bb
> index 79a4ad7..aad53b7 100644
> --- a/meta/recipes-devtools/strace/strace_4.8.bb
> +++ b/meta/recipes-devtools/strace/strace_4.8.bb
> @@ -19,7 +19,7 @@ inherit autotools ptest
>  RDEPENDS_${PN}-ptest += "make"
>  
>  PACKAGECONFIG_class-target ?= "libaio"
> -PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
> +PACKAGECONFIG_append_class-target = " ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"

Doesn't using _append make it unnecessary harder to changed default value
in .bbappend?

Why not use
PACKAGECONFIG_class-target ?= "libaio ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
at least in this case?

Thanks
Ming Liu - Oct. 20, 2013, 11:08 a.m.
On 10/20/2013 06:59 PM, Martin Jansa wrote:
> On Sun, Oct 20, 2013 at 06:48:31PM +0800, Ming Liu wrote:
>> In some cases, it's unfit to use "+=" in a conditional appending, we would
>> end up with the variable being set rather than being appended, which is not
>> it mean to.
>>
>> Signed-off-by: Ming Liu <ming.liu@windriver.com>
>> ---
>>   meta/recipes-devtools/strace/strace_4.8.bb | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-devtools/strace/strace_4.8.bb b/meta/recipes-devtools/strace/strace_4.8.bb
>> index 79a4ad7..aad53b7 100644
>> --- a/meta/recipes-devtools/strace/strace_4.8.bb
>> +++ b/meta/recipes-devtools/strace/strace_4.8.bb
>> @@ -19,7 +19,7 @@ inherit autotools ptest
>>   RDEPENDS_${PN}-ptest += "make"
>>   
>>   PACKAGECONFIG_class-target ?= "libaio"
>> -PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
>> +PACKAGECONFIG_append_class-target = " ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
> Doesn't using _append make it unnecessary harder to changed default value
> in .bbappend?
>
> Why not use
> PACKAGECONFIG_class-target ?= "libaio ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
> at least in this case?
Yes, it's reasonable and make things easy, I will do what you suggest in V1.

//Ming Liu

>
> Thanks
>

Patch

diff --git a/meta/recipes-devtools/strace/strace_4.8.bb b/meta/recipes-devtools/strace/strace_4.8.bb
index 79a4ad7..aad53b7 100644
--- a/meta/recipes-devtools/strace/strace_4.8.bb
+++ b/meta/recipes-devtools/strace/strace_4.8.bb
@@ -19,7 +19,7 @@  inherit autotools ptest
 RDEPENDS_${PN}-ptest += "make"
 
 PACKAGECONFIG_class-target ?= "libaio"
-PACKAGECONFIG_class-target += "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+PACKAGECONFIG_append_class-target = " ${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
 
 PACKAGECONFIG[libaio] = "--enable-aio,--disable-aio,libaio"
 PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"