Openembedded Core Discussions
 help / color / mirror / Atom feed
* [meta-oe][PATCH v2] rpm: fix rpm path in nativesdk
@ 2018-09-28  8:45 Zhaolong Zhang
  2018-09-28  9:11 ` Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Zhaolong Zhang @ 2018-09-28  8:45 UTC (permalink / raw)
  To: openembedded-core, richard.purdie, zhangzl2013

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.

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-28  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox