oe/utils: Drop all_distro_features
PATCH 1/2 oe/utils: Drop all_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.
--- meta/lib/oe/utils.py | 20 -------------------- 1 file changed, 20 deletions(-)
meta/lib/oe/utils.py +0 -20
@@ -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,
PATCH 2/2 oe/utils: Drop any_distro_features
It is just as easy to use bb.utils.contains_any("DISTRO_FEATURES", "x y", ...) and this function is just a wrapper. It isn't used anywhere in core.
The contains_any function is better optimised in bitbake too.
--- meta/lib/oe/utils.py | 21 --------------------- 1 file changed, 21 deletions(-)
meta/lib/oe/utils.py +0 -21
@@ -170,27 +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 any_distro_features(d, features, truevalue="1", falsevalue=""): - """ - Returns truevalue if at least *one* of the given features is 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_any("DISTRO_FEATURES", features, truevalue, falsevalue, d). - - Without explicit true/false values it can be used directly where - Python expects a boolean: - if not oe.utils.any_distro_features(d, "foo bar"): - bb.fatal("foo, bar or both must be set in 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.any_distro_features(d, "foo bar", "foo-or-bar.inc") - - """ - return bb.utils.contains_any("DISTRO_FEATURES", features, truevalue, falsevalue, d) - def parallel_make_value(pm): """ Return the integer value for the number of parallel threads to use when
there is one recipe atleast in meta-networking which is using it
Quoted 62 lines · Richard Purdie via lists.openembedded.org
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 <[email protected]>--- meta/lib/oe/utils.py | 20 -------------------- 1 file changed, 20 deletions(-)meta/lib/oe/utils.py +0
-0@@ -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)}')meta/lib/oe/utils.py +0
-4-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 oranything
meta/lib/oe/utils.py +0
-4- that can be turned into a set. - - This is a shorter, more flexible version of - bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue,d).
meta/lib/oe/utils.py +0
-7- - 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 meantto be
meta/lib/oe/utils.py +0
-2- used only when requested via DISTRO_FEATURES: - require ${@ oe.utils.all_distro_features(d, "foo bar","foo-and-bar.inc")
meta/lib/oe/utils.py +0
-2- """ - return bb.utils.contains("DISTRO_FEATURES", features, truevalue,falsevalue, d)
-
defany_distro_features(d, features, truevalue="1", falsevalue=""):
"""
Returns truevalue if at least *one* of the given features is set inDISTRO_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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-