[OE-core] [PATCH 1/1] meta/lib/oe/utils.py: properly implement both_contain()

Andre McCurdy armccurdy at gmail.com
Tue May 12 00:34:45 UTC 2015


On Wed, Feb 25, 2015 at 7:15 AM, Cristian Iorga
<cristian.iorga at intel.com> wrote:
> oe.utils.both_contain() just does a find() on the value
> rather than splitting the value and then looking in the
> list of split items. The result is that if you add a
> feature to MACHINE_FEATURES that itself has a substring
> that matches one of the values looked for when building
> COMBINED_FEATURES, you end up with an incomprehensible
> error (here with "ext2i" in MACHINE_FEATURES):
>
> ERROR: Nothing RPROVIDES 'packagegroup-base-ext2'
> (but /home/balister/src/oe-core/oe-core/meta/recipes-core/
> /packagegroups/packagegroup-base.bb RDEPENDS on or otherwise requires it)

This change seems to break COMBINED_FEATURES.

$ bitbake -e packagegroup-base | grep '^COMBINED_FEATURES='

dizzy:
  COMBINED_FEATURES="alsa         "

fido:
  COMBINED_FEATURES="set(['alsa'])         "


> Fix [YOCTO #6888].
>
> Signed-off-by: Cristian Iorga <cristian.iorga at intel.com>
> ---
>  meta/lib/oe/utils.py | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
> index 1f84ba4..bedade2 100644
> --- a/meta/lib/oe/utils.py
> +++ b/meta/lib/oe/utils.py
> @@ -42,7 +42,15 @@ def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
>          return falsevalue
>
>  def both_contain(variable1, variable2, checkvalue, d):
> -    if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1:
> +    val1 = d.getVar(variable1, True)
> +    val2 = d.getVar(variable2, True)
> +    val1 = set(val1.split())
> +    val2 = set(val2.split())
> +    if isinstance(checkvalue, basestring):
> +        checkvalue = set(checkvalue.split())
> +    else:
> +        checkvalue = set(checkvalue)
> +    if checkvalue.issubset(val1) and checkvalue.issubset(val2):
>          return checkvalue
>      else:
>          return ""
> --
> 2.1.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list