public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Peter Kjellerstedt" <peter.kjellerstedt@axis.com>
To: "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [master][zeus][PATCH] relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist
Date: Fri, 3 Apr 2020 16:24:21 +0000	[thread overview]
Message-ID: <6953e7ec71b64cf1b9a636b41b553b2b@XBOX03.axis.com> (raw)
In-Reply-To: <20200320180420.32303-1-pkj@axis.com>

*ping*

//Peter

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
> bounces@lists.openembedded.org> On Behalf Of Peter Kjellerstedt
> Sent: den 20 mars 2020 19:04
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [master][zeus][PATCH] 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.
> 
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.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.21.1

//Peter


  reply	other threads:[~2020-04-03 16:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 18:04 [master][zeus][PATCH] relocatable.bbclass: Avoid an exception if an empty pkgconfig dir exist Peter Kjellerstedt
2020-04-03 16:24 ` Peter Kjellerstedt [this message]
     [not found] ` <16025BE698C394B5.19764@lists.openembedded.org>
2020-04-25  9:16   ` [OE-core] " Peter Kjellerstedt
     [not found]   ` <16090558444D87E6.18576@lists.openembedded.org>
2020-05-28  1:25     ` Peter Kjellerstedt
     [not found]     ` <16130CCABBD4F064.18282@lists.openembedded.org>
2020-06-12 16:25       ` Peter Kjellerstedt
     [not found]       ` <1617D89C6070B90C.14082@lists.openembedded.org>
2020-06-17  1:50         ` Peter Kjellerstedt
2020-09-01 16:33           ` Andreas Müller
2020-09-01 16:41             ` Andreas Müller

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=6953e7ec71b64cf1b9a636b41b553b2b@XBOX03.axis.com \
    --to=peter.kjellerstedt@axis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox