cache.py: print debug info when EXCLUDE_FROM_WORLD

This gives us an easy way to find out which recipes have been excluded
from world when there are many layers.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bb/tests/data.py: add tests for contains() and contains_any()

contains_any is buggy so write a test case to demonstrate this.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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>.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>