| Message ID | 20260609074603.1429006-1-richard.purdie@linuxfoundation.org |
|---|---|
| State | New |
| Headers | show |
| Series | [1/2] oe/utils: Drop all_distro_features | expand |
there is one recipe atleast in meta-networking which is using it https://git.openembedded.org/meta-openembedded/tree/meta-networking/recipes-devtools/python/python3-scapy_2.6.1.bb#n45 On Tue, Jun 9, 2026 at 12:46 AM Richard Purdie via lists.openembedded.org <richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote: > It is just as easy to use bb.utils.contains("DISTRO_FEATURES", "x y", ...) > and this function is just a wrapper. It isn't used anywhere in core. > > The contains function is better optimised in bitbake too. > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > --- > meta/lib/oe/utils.py | 20 -------------------- > 1 file changed, 20 deletions(-) > > diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py > index 120b6443935..4e09a8b927f 100644 > --- a/meta/lib/oe/utils.py > +++ b/meta/lib/oe/utils.py > @@ -170,26 +170,6 @@ def set_class_filter(var, features_var, filter_var, > d): > bb.warn("Unexpanded variable %s in %s is not recommended" % > (issue, var)) > d.setVar(var, '${@oe.utils.class_filter_features("' + defaults + '", > "' + features_var + '", "' + filter_var + '", d)}') > > -def all_distro_features(d, features, truevalue="1", falsevalue=""): > - """ > - Returns truevalue if *all* given features are set in DISTRO_FEATURES, > - else falsevalue. The features can be given as single string or > anything > - that can be turned into a set. > - > - This is a shorter, more flexible version of > - bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue, > d). > - > - Without explicit true/false values it can be used directly where > - Python expects a boolean: > - if oe.utils.all_distro_features(d, "foo bar"): > - bb.fatal("foo and bar are mutually exclusive DISTRO_FEATURES") > - > - With just a truevalue, it can be used to include files that are meant > to be > - used only when requested via DISTRO_FEATURES: > - require ${@ oe.utils.all_distro_features(d, "foo bar", > "foo-and-bar.inc") > - """ > - return bb.utils.contains("DISTRO_FEATURES", features, truevalue, > falsevalue, d) > - > def any_distro_features(d, features, truevalue="1", falsevalue=""): > """ > Returns truevalue if at least *one* of the given features is set in > DISTRO_FEATURES, > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#238271): > https://lists.openembedded.org/g/openembedded-core/message/238271 > Mute This Topic: https://lists.openembedded.org/mt/119719566/1997914 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ > raj.khem@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- > >
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 120b6443935..4e09a8b927f 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -170,26 +170,6 @@ def set_class_filter(var, features_var, filter_var, d): bb.warn("Unexpanded variable %s in %s is not recommended" % (issue, var)) d.setVar(var, '${@oe.utils.class_filter_features("' + defaults + '", "' + features_var + '", "' + filter_var + '", d)}') -def all_distro_features(d, features, truevalue="1", falsevalue=""): - """ - Returns truevalue if *all* given features are set in DISTRO_FEATURES, - else falsevalue. The features can be given as single string or anything - that can be turned into a set. - - This is a shorter, more flexible version of - bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue, d). - - Without explicit true/false values it can be used directly where - Python expects a boolean: - if oe.utils.all_distro_features(d, "foo bar"): - bb.fatal("foo and bar are mutually exclusive DISTRO_FEATURES") - - With just a truevalue, it can be used to include files that are meant to be - used only when requested via DISTRO_FEATURES: - require ${@ oe.utils.all_distro_features(d, "foo bar", "foo-and-bar.inc") - """ - return bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue, d) - def any_distro_features(d, features, truevalue="1", falsevalue=""): """ Returns truevalue if at least *one* of the given features is set in DISTRO_FEATURES,
It is just as easy to use bb.utils.contains("DISTRO_FEATURES", "x y", ...) and this function is just a wrapper. It isn't used anywhere in core. The contains function is better optimised in bitbake too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- meta/lib/oe/utils.py | 20 -------------------- 1 file changed, 20 deletions(-)