[oe-commits] Cristian Iorga : meta/lib/oe/utils.py: properly implement both_contain()

git at git.openembedded.org git at git.openembedded.org
Mon Mar 9 17:59:38 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: e7375f73bd8052d012e35d4ebaee09a55417581f
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=e7375f73bd8052d012e35d4ebaee09a55417581f

Author: Cristian Iorga <cristian.iorga at intel.com>
Date:   Wed Feb 25 17:15:46 2015 +0200

meta/lib/oe/utils.py: properly implement both_contain()

oe.utils.both_contain() just does a find() on the value
rather than splitting the value and then looking in the
list of split items. The result is that if you add a
feature to MACHINE_FEATURES that itself has a substring
that matches one of the values looked for when building
COMBINED_FEATURES, you end up with an incomprehensible
error (here with "ext2i" in MACHINE_FEATURES):

ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
(but /home/balister/src/oe-core/oe-core/meta/recipes-core/
/packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)

Fix [YOCTO #6888].

Signed-off-by: Cristian Iorga <cristian.iorga at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/lib/oe/utils.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 1f84ba4..bedade2 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -42,7 +42,15 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
         return falsevalue
 
 def both_contain(variable1, variable2, checkvalue, d):
-    if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1:
+    val1 = d.getVar(variable1, True)
+    val2 = d.getVar(variable2, True)
+    val1 = set(val1.split())
+    val2 = set(val2.split())
+    if isinstance(checkvalue, basestring):
+        checkvalue = set(checkvalue.split())
+    else:
+        checkvalue = set(checkvalue)
+    if checkvalue.issubset(val1) and checkvalue.issubset(val2):
         return checkvalue
     else:
         return ""



More information about the Openembedded-commits mailing list