Patchwork [1/8] base.bbclass: fix PACKAGECONFIG handling code

login
register
mail settings
Submitter Ross Burton
Date Aug. 13, 2012, 6:58 p.m.
Message ID <b594f8c989894f960fa9b084e74e963ded794627.1344884283.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/34345/
State New
Headers show

Comments

Ross Burton - Aug. 13, 2012, 6:58 p.m.
From: Yao Zhao <yao.zhao@windriver.com>

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>
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/base.bbclass |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

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)