diff options
author | Peter Kjellerstedt <pkj@axis.com> | 2020-03-20 19:04:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-26 18:26:49 +0100 |
commit | 92b2e7e49efc0b1c62bcbf9159db776124bdd9d5 (patch) | |
tree | 2df5277afe77ae3a17381e643e549a6124f002a5 /meta/classes/relocatable.bbclass | |
parent | 994783b52e5c0a97000b8b643c8fd80d81069097 (diff) | |
download | poky-92b2e7e49efc0b1c62bcbf9159db776124bdd9d5.tar.gz |
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: ceffd920c7bdae29cd1a606f1c20d1b2d3666f5b)
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: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/relocatable.bbclass')
-rw-r--r-- | meta/classes/relocatable.bbclass | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass index 582812c1cf..af04be5cca 100644 --- a/meta/classes/relocatable.bbclass +++ b/meta/classes/relocatable.bbclass | |||
@@ -6,13 +6,15 @@ python relocatable_binaries_preprocess() { | |||
6 | rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) | 6 | rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d) |
7 | } | 7 | } |
8 | 8 | ||
9 | relocatable_native_pcfiles () { | 9 | relocatable_native_pcfiles() { |
10 | if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then | 10 | for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do |
11 | rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")} | 11 | files_template=${SYSROOT_DESTDIR}$dir/*.pc |
12 | sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc | 12 | # Expand to any files matching $files_template |
13 | fi | 13 | files=$(echo $files_template) |
14 | if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then | 14 | # $files_template and $files will differ if any files were found |
15 | rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")} | 15 | if [ "$files_template" != "$files" ]; then |
16 | sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc | 16 | rel=$(realpath -m --relative-to=$dir ${base_prefix}) |
17 | fi | 17 | sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files |
18 | fi | ||
19 | done | ||
18 | } | 20 | } |