From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Zhaolong Zhang <zhangzl2013@126.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>,
"richard.purdie@linuxfoundation.org"
<richard.purdie@linuxfoundation.org>
Subject: Re: [meta-oe][PATCH v2] rpm: fix rpm path in nativesdk
Date: Fri, 28 Sep 2018 09:11:16 +0000 [thread overview]
Message-ID: <35c22fa63952439c8cc1736fb8914899@XBOX02.axis.com> (raw)
In-Reply-To: <1538124327-25753-1-git-send-email-zhangzl2013@126.com>
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-bounces@lists.openembedded.org> On Behalf Of Zhaolong Zhang
> Sent: den 28 september 2018 10:45
> To: openembedded-core@lists.openembedded.org;
> richard.purdie@linuxfoundation.org; zhangzl2013@126.com
> Subject: [OE-core] [meta-oe][PATCH v2] rpm: fix rpm path in nativesdk
>
> Fix the incorrect path inside the nativesdk 'rpmdeps' wrapper:
>
> In os.path.relpath(), it was assumed that all the WRAPPER_TOOLS are in
> {bindir}, and all the relative paths was calculated based on {bindir}.
>
> However, the assumption was not true for 'rpmdeps' because it is in
> {libdir}/rpm/. So the path in rpmdeps wrapper was incorrectly calculated
> to ..../usr/lib/lib/rpm.
>
> To fix this, we can simply use $OECORE_NATIVE_SYSROOT as the base path,
> instead of the complicated runtime path calculation.
>
> The patch also fix the hard coded path in 'find-provides' and 'find-
> provides' for nativesdk.
Change the second 'find-provides' to 'find-requires'.
> Signed-off-by: Zhaolong Zhang <zhangzl2013@126.com>
> ---
>
> v1 --> v2:
> 1. upgrade commit message.
> 2. change ${libdir} to ${libdir_nativesdk}
> 3. change ${datadir} to {prefix_nativesdk}/share
>
> meta/recipes-devtools/rpm/rpm_4.14.2.bb | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-devtools/rpm/rpm_4.14.2.bb b/meta/recipes-devtools/rpm/rpm_4.14.2.bb
> index 46f8837..361e554 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.14.2.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.14.2.bb
> @@ -103,12 +103,15 @@ do_install_append_class-native() {
> do_install_append_class-nativesdk() {
> for tool in ${WRAPPER_TOOLS}; do
> create_wrapper ${D}$tool \
> - RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
> - RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/..} \
> - MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/misc/magic.mgc \
> + RPM_CONFIGDIR=$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/rpm \
> + RPM_ETCCONFIGDIR=$OECORE_NATIVE_SYSROOT/${base_prefix} \
> + MAGIC=$OECORE_NATIVE_SYSROOT/${prefix_nativesdk}/share/misc/magic.mgc \
> RPM_NO_CHROOT_FOR_SCRIPTS=1
> done
>
> + sed -i -e 's:\/usr\/lib\/rpm\/:$OECORE_NATIVE_SYSROOT\/usr\/lib\/rpm\/:' ${D}${libdir}/rpm/find-provides
> + sed -i -e 's:\/usr\/lib\/rpm\/:$OECORE_NATIVE_SYSROOT\/usr\/lib\/rpm\/:' ${D}${libdir}/rpm/find-requires
> +
> rm -rf ${D}/var
> }
>
> --
> 1.9.1
//Peter
prev parent reply other threads:[~2018-09-28 9:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 8:45 [meta-oe][PATCH v2] rpm: fix rpm path in nativesdk Zhaolong Zhang
2018-09-28 9:11 ` Peter Kjellerstedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35c22fa63952439c8cc1736fb8914899@XBOX02.axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
--cc=zhangzl2013@126.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox