[OE-core] [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg

Martin Jansa martin.jansa at gmail.com
Tue Oct 31 09:31:13 UTC 2017


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 at 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 at 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 at 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 at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20171031/5877850f/attachment-0002.html>


More information about the Openembedded-core mailing list