diff mbox series

[2/2] oe/utils: Drop any_distro_features

Message ID 20260609074603.1429006-2-richard.purdie@linuxfoundation.org
State New
Headers show
Series [1/2] oe/utils: Drop all_distro_features | expand

Commit Message

Richard Purdie June 9, 2026, 7:46 a.m. UTC
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oe/utils.py | 21 ---------------------
 1 file changed, 21 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 4e09a8b927f..18c48a145f0 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -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