diff options
| author | Ross Burton <ross.burton@intel.com> | 2014-06-11 11:04:44 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-06-12 17:47:59 +0100 |
| commit | 8e0c54cd0e82ffe120f84f495101cd29e6fd06bf (patch) | |
| tree | 9e729f3d6087b4195564b7ae0f9588f246d0f1a2 | |
| parent | 2261e9f4c8f27c4c0cd7a6f0786943ca166788b3 (diff) | |
| download | poky-8e0c54cd0e82ffe120f84f495101cd29e6fd06bf.tar.gz | |
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>
| -rw-r--r-- | bitbake/lib/bb/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 96d8218812..f62709bed5 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -851,7 +851,7 @@ def contains_any(variable, checkvalues, truevalue, falsevalue, d): | |||
| 851 | checkvalues = set(checkvalues.split()) | 851 | checkvalues = set(checkvalues.split()) |
| 852 | else: | 852 | else: |
| 853 | checkvalues = set(checkvalues) | 853 | checkvalues = set(checkvalues) |
| 854 | if checkvalues in val: | 854 | if checkvalues & val: |
| 855 | return truevalue | 855 | return truevalue |
| 856 | return falsevalue | 856 | return falsevalue |
| 857 | 857 | ||
