Skip to contentSkip to conversation

update-alternatives: Fix for compatibility with multilib recipes

PATCH Richard Purdie 2 participants 2 messages Apr 14, 2012

lore
Share & tools
lore
#0 lore raw

The PN == BPN test was designed to exclude native/nativesdk but also unfortunately excludes multilib unintentionally. This change fixes this and allows multilib images with alternatives to funciton correctly.

[YOCTO #2214]

---

meta/classes/update-alternatives.bbclass +3 -2
index ae58344..7b0518d 100644
@@ -69,15 +69,16 @@ done
 }
 
 update_alternatives_batch_doinstall() {
-if [ "${PN}" = "${BPN}" ] ; then
 	for link in ${ALTERNATIVE_LINKS}
 	do
 		mv ${D}${link} ${D}${link}.${PN}
 	done
-fi
 }
 
 def update_alternatives_after_parse(d):
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d):
+        return
+
     if d.getVar('ALTERNATIVE_LINKS') != None:
         doinstall = d.getVar('do_install', 0)
         doinstall += d.getVar('update_alternatives_batch_doinstall', 0)
#1 lore raw
Quoted 4 lines · Richard Purdie

 def update_alternatives_after_parse(d):
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d):
+        return
+

Not an issue, but wanted to point out we have a utility function for this sort of thing, for future reference. bb.utils.inherits(d, 'native', 'nativesdk'), iirc.

Signature · 1 line
Christopher Larson