[OE-core] [PATCH] base.bbclass: Add COMPATIBLE_DISTRO_FEATURES support

Otavio Salvador otavio at ossystems.com.br
Tue May 28 16:08:35 UTC 2013


On Tue, May 28, 2013 at 12:31 PM, Phil Blundell <pb at pbcl.net> wrote:

> On Tue, 2013-05-28 at 12:18 -0300, Otavio Salvador wrote:
>
> > +        need_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES',
> > True)
> > +        if need_distro_features:
> > +            need_distro_features = need_distro_features.split()
> > +            distro_features = (d.getVar('DISTRO_FEATURES', True) or
> > "").split()
> > +            for f in need_distro_features:
> > +                if f in distro_features:
> > +                    break
> > +            else:
> > +                raise bb.parse.SkipPackage("missing required distro
> > feature %s (not in DISTRO_FEATURES)" % need_distro_features)
>
> This is still not quite right.  The error message says that the features
> it mentions are "not in DISTRO_FEATURES", but it appears to still be
> listing everything that's named in REQUIRED_DISTRO_FEATURES whether or
> not it is actually in DISTRO_FEATURES.
>
> Also you seem to be printing a Python list with %s, which will work but
> the results aren't especially pretty.
>
> Also also, on a stylistic point, the "for/if/break" construct is a bit
> ugly.  You could perhaps consider something like:
>
> need_distro_features = need_distro_features.split()
> distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
> missing_distro_features = filter(lambda x: x not in distro_features,
> need_distro_features)
> if missing_distro_features:
>   raise bb.parse.SkipPackage("missing required distro features: %s" % "
> ".join(missing_distro_features))
>

I dislike the 'required' my idea here was each item of the 'compat distro
features' would be as an OR. Like

COMPATIBLE_DISTRO_FEATURE = "x11 wayland"

So *any* of those would make recipe to be parsed.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20130528/64707991/attachment-0002.html>


More information about the Openembedded-core mailing list