From: João Marcos Costa Date: Mon, 27 Apr 2026 13:08:44 +0000 (+0200) Subject: meta: simplify conditional operations with bb.utils.filter X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f38320c9646a;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git meta: simplify conditional operations with bb.utils.filter Some recipes use bb.utils.contains to check for a string inside a variable, and return the exact same string if true. This can be simplified by a call to bb.utils.filter, since the result is the same, and the inline is shorter. Replace "bb.utils.contains(A, 'a', 'a', '', d)" by "bb.utils.filter(A, 'a', d)". Signed-off-by: João Marcos Costa Reviewed-by: Quentin Schulz Signed-off-by: Mathieu Dubois-Briand --- diff --git a/meta/recipes-connectivity/connman/connman_2.0.bb b/meta/recipes-connectivity/connman/connman_2.0.bb index 6f7093301bf..e9873f31637 100644 --- a/meta/recipes-connectivity/connman/connman_2.0.bb +++ b/meta/recipes-connectivity/connman/connman_2.0.bb @@ -169,7 +169,7 @@ FILES:${PN}-tools = "${bindir}/wispr" RDEPENDS:${PN}-tools = "${PN}" FILES:${PN}-tests = "${bindir}/*-test" -RDEPENDS:${PN}-tests = "${@bb.utils.contains('PACKAGECONFIG', 'iptables', 'iptables', '', d)}" +RDEPENDS:${PN}-tests = "${@bb.utils.filter('PACKAGECONFIG', 'iptables', d)}" FILES:${PN}-client = "${bindir}/connmanctl" RDEPENDS:${PN}-client = "${PN}" diff --git a/meta/recipes-core/coreutils/coreutils_9.10.bb b/meta/recipes-core/coreutils/coreutils_9.10.bb index 8109244f446..ad4639b5ed9 100644 --- a/meta/recipes-core/coreutils/coreutils_9.10.bb +++ b/meta/recipes-core/coreutils/coreutils_9.10.bb @@ -224,6 +224,6 @@ do_install_ptest:append:libc-musl () { } RDEPENDS:${PN}-ptest += "xz \ - ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'acl', '', d)} \ + ${@bb.utils.filter('PACKAGECONFIG', 'acl', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'xattr', 'attr', '', d)}" FILES:${PN}-ptest += "${bindir}/getlimits" diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 19bcc4a96fa..958f42fc109 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb @@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=06357ddc23f46577c2aeaeaf7b776 # compiling OVMF twice, so it is disabled by default. Distros # may change that default. PACKAGECONFIG ??= "" -PACKAGECONFIG += "${@bb.utils.contains('MACHINE_FEATURES', 'tpm', 'tpm', '', d)}" +PACKAGECONFIG += "${@bb.utils.filter('MACHINE_FEATURES', 'tpm', d)}" PACKAGECONFIG += "${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'tpm', '', d)}" PACKAGECONFIG[debug] = ",,," PACKAGECONFIG[secureboot] = ",,," diff --git a/meta/recipes-extended/at/at_3.2.5.bb b/meta/recipes-extended/at/at_3.2.5.bb index 112d1c4adcb..ee485f67ec8 100644 --- a/meta/recipes-extended/at/at_3.2.5.bb +++ b/meta/recipes-extended/at/at_3.2.5.bb @@ -9,7 +9,7 @@ DEPENDS = "flex flex-native bison-native \ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" PACKAGECONFIG ?= "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \ " PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," diff --git a/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb b/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb index 18eeaa5523f..c76763f8115 100644 --- a/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb +++ b/meta/recipes-graphics/libglvnd/libglvnd_1.7.0.bb @@ -14,7 +14,7 @@ REQUIRED_DISTRO_FEATURES = "opengl glvnd" inherit meson pkgconfig features_check PACKAGECONFIG ?= "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl gles1 gles2', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)} \ " diff --git a/meta/recipes-graphics/waffle/waffle_1.8.1.bb b/meta/recipes-graphics/waffle/waffle_1.8.1.bb index aefa0069cf2..5d993cf254b 100644 --- a/meta/recipes-graphics/waffle/waffle_1.8.1.bb +++ b/meta/recipes-graphics/waffle/waffle_1.8.1.bb @@ -21,7 +21,7 @@ DEPENDS:append = " python3" # This should be overridden per-machine to reflect the capabilities of the GL # stack. PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx x11-egl', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gbm surfaceless-egl', '', d)} \ " diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.28.2.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.28.2.bb index cdf3a20dff6..9945e79bf70 100644 --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.28.2.bb +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.28.2.bb @@ -25,7 +25,7 @@ PACKAGECONFIG ??= " \ ${GSTREAMER_ORC} \ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \ ${@bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan x11', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)} \ bz2 closedcaption curl dash dtls hls openssl sbc smoothstreaming \ sndfile ttml uvch264 webp analytics \