* [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg
@ 2017-10-31 2:12 Li Zhou
2017-10-31 9:31 ` Martin Jansa
0 siblings, 1 reply; 2+ messages in thread
From: Li Zhou @ 2017-10-31 2:12 UTC (permalink / raw)
To: openembedded-core
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg
2017-10-31 2:12 [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg Li Zhou
@ 2017-10-31 9:31 ` Martin Jansa
0 siblings, 0 replies; 2+ messages in thread
From: Martin Jansa @ 2017-10-31 9:31 UTC (permalink / raw)
To: Li Zhou; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]
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 #2: Type: text/html, Size: 3552 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-31 9:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 2:12 [PATCH v4] opkg-utils: Change alternatives lib path from /usr/lib/opkg to /var/lib/opkg Li Zhou
2017-10-31 9:31 ` Martin Jansa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.