diff options
-rw-r--r-- | bitbake/lib/bb/codeparser.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/utils.py | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index de8d2eb08d..8439efbb2e 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
@@ -103,7 +103,7 @@ class BufferedLogger(Logger): | |||
103 | 103 | ||
104 | class PythonParser(): | 104 | class PythonParser(): |
105 | getvars = ("d.getVar", "bb.data.getVar", "data.getVar", "d.appendVar", "d.prependVar") | 105 | getvars = ("d.getVar", "bb.data.getVar", "data.getVar", "d.appendVar", "d.prependVar") |
106 | containsfuncs = ("bb.utils.contains", "base_contains", "oe.utils.contains") | 106 | containsfuncs = ("bb.utils.contains", "base_contains", "oe.utils.contains", "bb.utils.contains_any") |
107 | execfuncs = ("bb.build.exec_func", "bb.build.exec_task") | 107 | execfuncs = ("bb.build.exec_func", "bb.build.exec_task") |
108 | 108 | ||
109 | def warn(self, func, arg): | 109 | def warn(self, func, arg): |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 0be45e1af6..1be1874cbc 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -845,6 +845,19 @@ def contains(variable, checkvalues, truevalue, falsevalue, d): | |||
845 | return truevalue | 845 | return truevalue |
846 | return falsevalue | 846 | return falsevalue |
847 | 847 | ||
848 | def contains_any(variable, checkvalues, truevalue, falsevalue, d): | ||
849 | val = d.getVar(variable, True) | ||
850 | if not val: | ||
851 | return falsevalue | ||
852 | val = set(val.split()) | ||
853 | if isinstance(checkvalues, basestring): | ||
854 | checkvalues = set(checkvalues.split()) | ||
855 | else: | ||
856 | checkvalues = set(checkvalues) | ||
857 | if checkvalues in val: | ||
858 | return truevalue | ||
859 | return falsevalue | ||
860 | |||
848 | def cpu_count(): | 861 | def cpu_count(): |
849 | return multiprocessing.cpu_count() | 862 | return multiprocessing.cpu_count() |
850 | 863 | ||