1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 01:19:52 +00:00

relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist

Rewrite relocatable_native_pcfiles() so that it can handle that any of
the checked pkgconfig directories are empty without causing an
exception.

(From OE-Core rev: d449e6b536c197b6723dab1d61e989706c14f19c)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f9c5df6dc1c13e9b05ff1b47ad84ad339f6779a4)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Peter Kjellerstedt
2020-03-20 19:04:20 +01:00
committed by Richard Purdie
parent f8fcc057d5
commit ab25229636
+11 -9
View File
@@ -6,13 +6,15 @@ python relocatable_binaries_preprocess() {
rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
} }
relocatable_native_pcfiles () { relocatable_native_pcfiles() {
if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do
rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")} files_template=${SYSROOT_DESTDIR}$dir/*.pc
sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc # Expand to any files matching $files_template
fi files=$(echo $files_template)
if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then # $files_template and $files will differ if any files were found
rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")} if [ "$files_template" != "$files" ]; then
sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc rel=$(realpath -m --relative-to=$dir ${base_prefix})
fi sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files
fi
done
} }