All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [zeus][PATCH 09/10] relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist
Date: Thu,  2 Jul 2020 08:54:11 +0800	[thread overview]
Message-ID: <d449e6b536c197b6723dab1d61e989706c14f19c.1593474787.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1593474787.git.anuj.mittal@intel.com>

From: Peter Kjellerstedt <pkj@axis.com>

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

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>
---
 meta/classes/relocatable.bbclass | 20 +++++++++++---------
 1 file 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() {
     rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
 }
 
-relocatable_native_pcfiles () {
-	if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
-		rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
-		sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
-	fi
-	if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
-		rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
-		sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
-	fi
+relocatable_native_pcfiles() {
+	for dir in ${libdir}/pkgconfig ${datadir}/pkgconfig; do
+		files_template=${SYSROOT_DESTDIR}$dir/*.pc
+		# Expand to any files matching $files_template
+		files=$(echo $files_template)
+		# $files_template and $files will differ if any files were found
+		if [ "$files_template" != "$files" ]; then
+			rel=$(realpath -m --relative-to=$dir ${base_prefix})
+			sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" $files
+		fi
+	done
 }
-- 
2.25.4


  parent reply	other threads:[~2020-07-02  0:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  0:54 [zeus][PATCH 00/10] zeus review request Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 01/10] nfs-utils: fix CVE-2019-3689 Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 02/10] python3: make gdbm optional Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 03/10] python3: un-break disabling the readline PACKAGECONFIG Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 04/10] libjpeg-turbo: Fix CVE-2020-13790 Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 05/10] qemu: fix CVE-2020-10702 & CVE-2020-13765 Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 06/10] gnutls: fixed CVE-2020-13777 Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 07/10] kernel-fitimage: introduce FIT_SIGN_ALG Anuj Mittal
2020-07-02  0:54 ` [zeus][PATCH 08/10] kernel.bbclass: Fix Module.symvers support Anuj Mittal
2020-07-04 21:13   ` [OE-core] " Adrian Bunk
2020-07-05 14:09     ` Richard Purdie
2020-07-06  0:14     ` Anuj Mittal
2020-07-02  0:54 ` Anuj Mittal [this message]
2020-07-15 20:01   ` [OE-core] [zeus][PATCH 09/10] relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist Andre McCurdy
2020-07-02  0:54 ` [zeus][PATCH 10/10] libpam: Remove option 'obscure' from common-password Anuj Mittal
2020-07-02  1:02 ` ✗ patchtest: failure for zeus review request (rev3) Patchwork

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=d449e6b536c197b6723dab1d61e989706c14f19c.1593474787.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.