rpm: Simplify the creation of wrappers for the native tools

Use a loop rather than calling create_wrapper for each individual
tool.

(From OE-Core rev: d052c534c5099b9927ec84b23e01341f0aa3ce7d)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Kjellerstedt 2017-08-29 23:21:06 +02:00 committed by Richard Purdie
parent 14effcc3d6
commit e6aa58d0b0
1 changed files with 18 additions and 53 deletions

View File

@ -67,62 +67,27 @@ BBCLASSEXTEND = "native nativesdk"
# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
# libmagic also has sysroot path contamination, so override it # libmagic also has sysroot path contamination, so override it
do_install_append_class-native() { do_install_append_class-native() {
create_wrapper ${D}/${bindir}/rpmbuild \ tools="\
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ ${bindir}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ ${bindir}/rpm2archive \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ ${bindir}/rpm2cpio \
RPM_NO_CHROOT_FOR_SCRIPTS=1 ${bindir}/rpmbuild \
${bindir}/rpmdb \
${bindir}/rpmgraph \
${bindir}/rpmkeys \
${bindir}/rpmsign \
${bindir}/rpmspec \
"
create_wrapper ${D}/${bindir}/rpmsign \ for tool in $tools; do
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ create_wrapper ${D}$tool \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
RPM_NO_CHROOT_FOR_SCRIPTS=1 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpmkeys \ done
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpm \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpm2archive \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpm2cpio \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpmdb \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpmgraph \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
create_wrapper ${D}/${bindir}/rpmspec \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
RPM_NO_CHROOT_FOR_SCRIPTS=1
} }
# Rpm's make install creates var/tmp which clashes with base-files packaging # Rpm's make install creates var/tmp which clashes with base-files packaging
do_install_append_class-target() { do_install_append_class-target() {
rm -rf ${D}/var rm -rf ${D}/var