Patchwork [bitbake-devel,2/2] bb/utils: fix contains_any()

mail settings
Submitter Ross Burton
Date June 11, 2014, 10:04 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/73605/
State New
Headers show


Ross Burton - June 11, 2014, 10:04 a.m.
"set1 in set2" doesn't do what you'd expect, and if it did do a subset test
that's not the logic required by contains_any().

Instead get the intersection of checkvalues and val and check if the resulting
set is empty or not (by evaluating it in a boolean context), which tells us if
there are any elements in common.

Based on a patch by Valentin Popa <>.

Signed-off-by: Ross Burton <>
 bitbake/lib/bb/ |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 96d8218..f62709b 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -851,7 +851,7 @@  def contains_any(variable, checkvalues, truevalue, falsevalue, d):
         checkvalues = set(checkvalues.split())
         checkvalues = set(checkvalues)
-    if checkvalues in val:
+    if checkvalues & val:
         return truevalue
     return falsevalue