Patchwork base.bbclass: fix PACKAGECONFIG handling code

login
register
mail settings
Submitter Yao Zhao
Date Aug. 2, 2012, 4:06 p.m.
Message ID <1343923596-28854-1-git-send-email-yao.zhao@windriver.com>
Download mbox | patch
Permalink /patch/33677/
State Accepted
Commit 884cab0428cff2ffd070b6f36b688ca9851fbe43
Headers show

Comments

Yao Zhao - Aug. 2, 2012, 4:06 p.m.
PACKAGECONFIG flag code only handles that when it has 3 or 4 items in flag,
it may have a stale data if some flags doesn't need DEPENDS and RDEPENDS.

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
---
 meta/classes/base.bbclass |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
Saul Wold - Aug. 16, 2012, 5:48 p.m.
On 08/02/2012 09:06 AM, Yao Zhao wrote:
> PACKAGECONFIG flag code only handles that when it has 3 or 4 items in flag,
> it may have a stale data if some flags doesn't need DEPENDS and RDEPENDS.
>
> Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
> ---
>   meta/classes/base.bbclass |   25 ++++++++++++-------------
>   1 file changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index e15fa26..3e6a7de 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -364,20 +364,19 @@ python () {
>               if flag == "defaultval":
>                   continue
>               items = flagval.split(",")
> -            if len(items) == 3:
> -                enable, disable, depend = items
> -                rdepend = ""
> -            elif len(items) == 4:
> -                enable, disable, depend, rdepend = items
> +            num = len(items)
> +            if num > 4:
> +                bb.error("Only enable,disable,depend,rdepend can be specified!")
> +
>               if flag in pkgconfig:
> -                if depend:
> -                    extradeps.append(depend)
> -                if rdepend:
> -                    extrardeps.append(rdepend)
> -                if enable:
> -                    extraconf.append(enable)
> -            elif disable:
> -                    extraconf.append(disable)
> +                if num >= 3 and items[2]:
> +                    extradeps.append(items[2])
> +                if num >= 4 and items[3]:
> +                    extrardeps.append(items[3])
> +                if num >= 1 and items[0]:
> +                    extraconf.append(items[0])
> +            elif num >= 2 and items[1]:
> +                    extraconf.append(items[1])
>           appendVar('DEPENDS', extradeps)
>           appendVar('RDEPENDS_${PN}', extrardeps)
>           appendVar('EXTRA_OECONF', extraconf)
>

Merged into OE-Core

Thanks
	Sau!
Saul Wold - Aug. 16, 2012, 8:02 p.m.
On 08/16/2012 10:48 AM, Saul Wold wrote:
> On 08/02/2012 09:06 AM, Yao Zhao wrote:
>> PACKAGECONFIG flag code only handles that when it has 3 or 4 items in
>> flag,
>> it may have a stale data if some flags doesn't need DEPENDS and RDEPENDS.
>>
>> Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
>> ---
>>   meta/classes/base.bbclass |   25 ++++++++++++-------------
>>   1 file changed, 12 insertions(+), 13 deletions(-)
>>
>> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>> index e15fa26..3e6a7de 100644
>> --- a/meta/classes/base.bbclass
>> +++ b/meta/classes/base.bbclass
>> @@ -364,20 +364,19 @@ python () {
>>               if flag == "defaultval":
>>                   continue
>>               items = flagval.split(",")
>> -            if len(items) == 3:
>> -                enable, disable, depend = items
>> -                rdepend = ""
>> -            elif len(items) == 4:
>> -                enable, disable, depend, rdepend = items
>> +            num = len(items)
>> +            if num > 4:
>> +                bb.error("Only enable,disable,depend,rdepend can be
>> specified!")
>> +
>>               if flag in pkgconfig:
>> -                if depend:
>> -                    extradeps.append(depend)
>> -                if rdepend:
>> -                    extrardeps.append(rdepend)
>> -                if enable:
>> -                    extraconf.append(enable)
>> -            elif disable:
>> -                    extraconf.append(disable)
>> +                if num >= 3 and items[2]:
>> +                    extradeps.append(items[2])
>> +                if num >= 4 and items[3]:
>> +                    extrardeps.append(items[3])
>> +                if num >= 1 and items[0]:
>> +                    extraconf.append(items[0])
>> +            elif num >= 2 and items[1]:
>> +                    extraconf.append(items[1])
>>           appendVar('DEPENDS', extradeps)
>>           appendVar('RDEPENDS_${PN}', extrardeps)
>>           appendVar('EXTRA_OECONF', extraconf)
>>
>
> Merged into OE-Core
>
My mistake not merged.

Sau!

> Thanks
>      Sau!
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>

Patch

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e15fa26..3e6a7de 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -364,20 +364,19 @@  python () {
             if flag == "defaultval":
                 continue
             items = flagval.split(",")
-            if len(items) == 3:
-                enable, disable, depend = items
-                rdepend = ""
-            elif len(items) == 4:
-                enable, disable, depend, rdepend = items
+            num = len(items)
+            if num > 4:
+                bb.error("Only enable,disable,depend,rdepend can be specified!")
+
             if flag in pkgconfig:
-                if depend:
-                    extradeps.append(depend)
-                if rdepend:
-                    extrardeps.append(rdepend)
-                if enable:
-                    extraconf.append(enable)
-            elif disable:
-                    extraconf.append(disable)
+                if num >= 3 and items[2]:
+                    extradeps.append(items[2])
+                if num >= 4 and items[3]:
+                    extrardeps.append(items[3])
+                if num >= 1 and items[0]:
+                    extraconf.append(items[0])
+            elif num >= 2 and items[1]:
+                    extraconf.append(items[1])
         appendVar('DEPENDS', extradeps)
         appendVar('RDEPENDS_${PN}', extrardeps)
         appendVar('EXTRA_OECONF', extraconf)