[OE-core] [PATCH] update-alternatives: Don't process duplicated entries

Jeremy Puhlman jpuhlman at mvista.com
Sat Jun 16 00:59:49 UTC 2018


If ALTERNATIVE_<pkg> lists the same entry more then once, the
update-alternatives identical install and remove actions are added for
each repeated entry. This is exhibited when you add meta-selinux, and
examine the busybox package, which installs every link twice because it
alters the links to point to the shell replacements so selinux will work
with them. This can generate warnings on do_rootfs about similarly
prioritized alternatives. Given that at this point in the processing
the addtions should always be identical there shouldn't be any good
reason to add them twice.

Signed-off-by: Jeremy Puhlman <jpuhlman at mvista.com>
---
 meta/classes/update-alternatives.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index aa01058..2c01c8b 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -207,7 +207,11 @@ python populate_packages_updatealternatives () {
         # Create post install/removal scripts
         alt_setup_links = ""
         alt_remove_links = ""
+        already_processed = set()
         for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+            if alt_name in already_processed:
+               continue
+            already_processed.add(alt_name)
             alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
             alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
             alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
-- 
2.6.4




More information about the Openembedded-core mailing list