diff options
author | Cristian Iorga <cristian.iorga@intel.com> | 2015-02-25 17:15:46 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-10 10:47:39 +0000 |
commit | ca3a3c05414f52bd9c2c9774248b7b74b60df20c (patch) | |
tree | f049b72401e006b044b66d811b518cae2c385643 /meta/lib/oe/utils.py | |
parent | d5a28582be7515d68ea7a44df37e1401fee36f8b (diff) | |
download | poky-ca3a3c05414f52bd9c2c9774248b7b74b60df20c.tar.gz |
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].
(From OE-Core rev: e7375f73bd8052d012e35d4ebaee09a55417581f)
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/utils.py')
-rw-r--r-- | meta/lib/oe/utils.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 1f84ba4b25..bedade292b 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): | |||
42 | return falsevalue | 42 | return falsevalue |
43 | 43 | ||
44 | def both_contain(variable1, variable2, checkvalue, d): | 44 | def both_contain(variable1, variable2, checkvalue, d): |
45 | if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1: | 45 | val1 = d.getVar(variable1, True) |
46 | val2 = d.getVar(variable2, True) | ||
47 | val1 = set(val1.split()) | ||
48 | val2 = set(val2.split()) | ||
49 | if isinstance(checkvalue, basestring): | ||
50 | checkvalue = set(checkvalue.split()) | ||
51 | else: | ||
52 | checkvalue = set(checkvalue) | ||
53 | if checkvalue.issubset(val1) and checkvalue.issubset(val2): | ||
46 | return checkvalue | 54 | return checkvalue |
47 | else: | 55 | else: |
48 | return "" | 56 | return "" |