[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opk
From:       Martin Jansa <martin.jansa () gmail ! com>
Date:       2017-10-31 9:31:13
Message-ID: CA+chaQe9CXqy3ZFVC_yu-Rk6dtviS_Z559RG-ttUWONAkpUFFQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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't ideal.

On Tue, Oct 31, 2017 at 3:12 AM, Li Zhou <li.zhou@windriver.com> wrote:

> When update-alternatives is moved from opkg to opkg-utils, a line in
> the file is changed
> from <ad="$OPKG_OFFLINE_ROOT@opkglibdir@/opkg/alternatives">
> to <ad="$OPKG_OFFLINE_ROOT/usr/lib/opkg/alternatives">.
> But opkglibdir doesn't equal to "/usr/lib" here, but equal to "/var/lib"
>  in oe-core build by configuring --with-opkglibdir.
> opkg-utils can't get the var value in opkg, so here define OPKGLIBDIR to
> set the path.
>
> Signed-off-by: Li Zhou <li.zhou@windriver.com>
> ---
>  meta/recipes-devtools/opkg-utils/opkg-utils_0.3.5.bb | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.5.bb
> b/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.5.bb
> index 646cc8f..ea32246 100644
> --- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.5.bb
> +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.5.bb
> @@ -25,6 +25,8 @@ PACKAGECONFIG = "python update-alternatives"
>  PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
>  PACKAGECONFIG[update-alternatives] = ",,,"
>
> +target_localstatedir := "${localstatedir}"
> +OPKGLIBDIR = "${target_localstatedir}/lib"
>  do_install() {
>         oe_runmake PREFIX=${prefix} DESTDIR=${D} install
>         if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives',
> 'true', 'false', d)}; then
> @@ -34,6 +36,7 @@ do_install() {
>      if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true',
> 'false', d)}; then
>          grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
>      fi
> +    sed -i s:/usr/lib/opkg:${OPKGLIBDIR}/opkg: ${D}${bindir}/update-
> alternatives
>  }
>
>  do_install_append_class-target() {
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[Attachment #5 (text/html)]

<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>



-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic