<div dir="ltr">Do you realize that this completely break the existing alternatives on target when upgrading from the binary feed? In oe-classic days I wrote migration script executed in postinst to recover from the worst breakage, but it still wasn&#39;t ideal.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 31, 2017 at 3:12 AM, Li Zhou <span dir="ltr">&lt;<a href="mailto:li.zhou@windriver.com" target="_blank">li.zhou@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When update-alternatives is moved from opkg to opkg-utils, a line in<br>
the file is changed<br>
from &lt;ad=&quot;$OPKG_OFFLINE_ROOT@<wbr>opkglibdir@/opkg/alternatives&quot;<wbr>&gt;<br>
to &lt;ad=&quot;$OPKG_OFFLINE_ROOT/usr/<wbr>lib/opkg/alternatives&quot;&gt;.<br>
But opkglibdir doesn&#39;t equal to &quot;/usr/lib&quot; here, but equal to &quot;/var/lib&quot;<br>
 in oe-core build by configuring --with-opkglibdir.<br>
opkg-utils can&#39;t get the var value in opkg, so here define OPKGLIBDIR to<br>
set the path.<br>
<br>
Signed-off-by: Li Zhou &lt;<a href="mailto:li.zhou@windriver.com">li.zhou@windriver.com</a>&gt;<br>
---<br>
 meta/recipes-devtools/opkg-<wbr>utils/<a href="http://opkg-utils_0.3.5.bb" rel="noreferrer" target="_blank">opkg-utils_0.3.5.bb</a> | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/meta/recipes-devtools/opkg-<wbr>utils/<a href="http://opkg-utils_0.3.5.bb" rel="noreferrer" target="_blank">opkg-utils_0.3.5.bb</a> b/meta/recipes-devtools/opkg-<wbr>utils/<a href="http://opkg-utils_0.3.5.bb" rel="noreferrer" target="_blank">opkg-utils_0.3.5.bb</a><br>
index 646cc8f..ea32246 100644<br>
--- a/meta/recipes-devtools/opkg-<wbr>utils/<a href="http://opkg-utils_0.3.5.bb" rel="noreferrer" target="_blank">opkg-utils_0.3.5.bb</a><br>
+++ b/meta/recipes-devtools/opkg-<wbr>utils/<a href="http://opkg-utils_0.3.5.bb" rel="noreferrer" target="_blank">opkg-utils_0.3.5.bb</a><br>
@@ -25,6 +25,8 @@ PACKAGECONFIG = &quot;python update-alternatives&quot;<br>
 PACKAGECONFIG[python] = &quot;,,,${PYTHONRDEPS}&quot;<br>
 PACKAGECONFIG[update-<wbr>alternatives] = &quot;,,,&quot;<br>
<br>
+target_localstatedir := &quot;${localstatedir}&quot;<br>
+OPKGLIBDIR = &quot;${target_localstatedir}/lib&quot;<br>
 do_install() {<br>
        oe_runmake PREFIX=${prefix} DESTDIR=${D} install<br>
        if ! ${@bb.utils.contains(&#39;<wbr>PACKAGECONFIG&#39;, &#39;update-alternatives&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then<br>
@@ -34,6 +36,7 @@ do_install() {<br>
     if ! ${@bb.utils.contains(&#39;<wbr>PACKAGECONFIG&#39;, &#39;python&#39;, &#39;true&#39;, &#39;false&#39;, d)}; then<br>
         grep -lZ &quot;/usr/bin/env.*python&quot; ${D}${bindir}/* | xargs -0 rm<br>
     fi<br>
+    sed -i s:/usr/lib/opkg:${OPKGLIBDIR}/<wbr>opkg: ${D}${bindir}/update-<wbr>alternatives<br>
 }<br>
<br>
 do_install_append_class-<wbr>target() {<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>