diff mbox series

[meta-oe,1/3] uutils-coreutils: Only provide coreutils when selected

Message ID 20261101153414.1370959-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,1/3] uutils-coreutils: Only provide coreutils when selected | expand

Commit Message

Khem Raj Nov. 1, 2026, 3:34 p.m. UTC
Universe builds every recipe and ignores EXCLUDE_FROM_WORLD, so the
unconditional PROVIDES puts this recipe and GNU coreutils in the same
build, and bitbake -c fetch universe reports that multiple .bb files
provide coreutils, coreutils-native and nativesdk-coreutils.

Claim the name only when this recipe is the preferred provider, checked
separately for the target, native and nativesdk variants so they can
still be selected independently.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../recipes-core/uutils-coreutils/uutils-coreutils_0.12.0.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.12.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.12.0.bb
index 53866d6f80..c647b7764b 100644
--- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.12.0.bb
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.12.0.bb
@@ -15,7 +15,10 @@  SRCREV = "dc1efd89948a9ca4c78c3a4b9a6ac891019a8c69"

 require ${BPN}-crates.inc

-PROVIDES = "coreutils"
+# Only claim coreutils when selected, separately for each of the target, native
+# and nativesdk variants. Unlike world, universe builds every recipe, so an
+# unconditional PROVIDES makes both recipes provide coreutils in the same build.
+PROVIDES = "${@'coreutils' if d.getVar('PREFERRED_PROVIDER_' + d.getVar('PN').replace('uutils-', '')) == d.getVar('PN') else ''}"
 RPROVIDES:${PN} = "coreutils"

 # This recipe is a drop-in replacement for coreutils and cannot coexist with it,