Re: [PATCH 2/2] utils.py: helper function for optional include files

Richard Purdie
2017-06-09T10:02:34Z

On Thu, 2017-06-08 at 16:36 +0200, Patrick Ohly wrote:
> On Thu, 2017-06-08 at 10:20 +0100, Richard Purdie wrote:
> >
> > require ${@bb.utils.contains(d, "DISTRO_FEATURES", "xyz", "x.inc
> > y.inc z.inc", "")}
> >
> > How about simply:
> >
> > require ${@oe.utils.distro_features(d, "foo bar", "foo-or-
> > bar.inc")}
> > require ${@bb.utils.distro_features(d, "xyz", "x.inc y.inc z.inc")}
> That works for me, I just wonder about the exact semantic of listing
> multiple features: "and" as in contains(), or "any"?
>
> I'm leaning towards two functions where that is explicit:
>   oe.utils.all_distro_features(d, "foo bar", "foo-and-bar.inc")
>   oe.utils.any_distro_features(d, "foo bar", "foo-or-bar.inc")

I think you're right, this distinction is easily missed and I think its
an idea to highlight it as you propose...

Cheers,

Richard