mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 21:32:12 +02:00
bitbake: bb/utils: fix contains_any()
"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 <valentin.popa@intel.com>. (Bitbake rev: 2e742c03e8dfdfa67899e7f5d579ed14bd87e139) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2261e9f4c8
commit
8e0c54cd0e
@@ -851,7 +851,7 @@ def contains_any(variable, checkvalues, truevalue, falsevalue, d):
|
||||
checkvalues = set(checkvalues.split())
|
||||
else:
|
||||
checkvalues = set(checkvalues)
|
||||
if checkvalues in val:
|
||||
if checkvalues & val:
|
||||
return truevalue
|
||||
return falsevalue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user