diff options
-rw-r--r-- | meta/lib/oe/utils.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index f6d4142c12..5a63ed3c3b 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -35,16 +35,15 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): return falsevalue def contains(variable, checkvalues, truevalue, falsevalue, d): - val = bb.data.getVar(variable,d,1) + val = d.getVar(variable, True) if not val: return falsevalue - matches = 0 - if type(checkvalues).__name__ == "str": - checkvalues = [checkvalues] - for value in checkvalues: - if val.find(value) != -1: - matches = matches + 1 - if matches == len(checkvalues): + val = set(val.split()) + if isinstance(checkvalues, basestring): + checkvalues = set(checkvalues.split()) + else: + checkvalues = set(checkvalues) + if checkvalues.issubset(val): return truevalue return falsevalue |