uutils-coreutils: Only provide coreutils when selected

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>
This commit is contained in:
Khem Raj committed 2026-11-01 16:27:04 -08:00
1 parent d2c8362c71
commit 981fbbed9c
1 file changed
+4 -1
@@ -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,