Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 4/4] scripts/postinst-intercepts: create separete hooks for multilib
Date: Thu, 25 Apr 2013 08:51:26 -0500	[thread overview]
Message-ID: <517934DE.90303@windriver.com> (raw)
In-Reply-To: <f0a9ef998eba08dce22e9a931e34f89c6c2c34e7.1366892003.git.laurentiu.palcu@intel.com>

On 4/25/13 7:24 AM, Laurentiu Palcu wrote:
> When using multilib, the hooks for lib32/lib64 must be different because
> the libdir/base_libdir point to different locations. Nothing has to be
> done in the postinstalls for this. When a hook is installed, it will be
> detected automatically if this is a ML package (from the libXX- package
> prefix) and a separate hook will be created.
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
>   scripts/postinst-intercepts/postinst_intercept |   18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
> diff --git a/scripts/postinst-intercepts/postinst_intercept b/scripts/postinst-intercepts/postinst_intercept
> index ed32f27..5969eba 100755
> --- a/scripts/postinst-intercepts/postinst_intercept
> +++ b/scripts/postinst-intercepts/postinst_intercept
> @@ -17,9 +17,27 @@
>
>   intercept_script=$INTERCEPT_DIR/$1 && shift
>   package_name=$1 && shift
> +mlprefix=$(echo $package_name|sed -rn 's/^(lib32|lib64|libx32)-.*/\1/p')

The mlprefix is theoretically arbitrary.  It would be better to base the parse 
list off of a given machines available multilibs.  If you can dump the multilib 
list from bitbake, that would be best.

> +# if the hook we want to install does not exist, then there's nothing we can do
>   [ -f "$intercept_script" ] || exit 1
>
> +# if the postinstall wanting to install the hook belongs to a multilib package,
> +# then we'd better have a separate hook for this because the default ${libdir} and
> +# ${base_libdir} will point to the wrong locations
> +if [ -n "$mlprefix" ]; then
> +	ml_intercept_script=$intercept_script-$mlprefix
> +	# if the multilib hook does not exist, create it from the default one
> +	if [ ! -f "$ml_intercept_script" ]; then
> +		cp $intercept_script $ml_intercept_script
> +
> +		# clear the ##PKGS: line and the already set variables
> +		[ -x "$ml_intercept_script" ] && sed -i -e "2,$(($#+1)) {/.*/d}" -e "/^##PKGS: .*/d" $ml_intercept_script
> +	fi
> +
> +	intercept_script=$ml_intercept_script
> +fi
> +
>   chmod +x "$intercept_script"
>
>   pkgs_line="$(cat $intercept_script|grep "##PKGS:")"
>




  reply	other threads:[~2013-04-25 14:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-25 12:23 [PATCH 0/4] Multilib related postinstall fixes Laurentiu Palcu
2013-04-25 12:23 ` [PATCH 1/4] qemuwrapper: use fallback in case the ELF binary is wrong Laurentiu Palcu
2013-04-25 12:23 ` [PATCH 2/4] pango: fix postinstall when using multilib Laurentiu Palcu
2013-04-25 12:23 ` [PATCH 3/4] Revert "qemu.bbclass: Use the correct qemu binary in multilib cases" Laurentiu Palcu
2013-04-25 12:24 ` [PATCH 4/4] scripts/postinst-intercepts: create separete hooks for multilib Laurentiu Palcu
2013-04-25 13:51   ` Mark Hatle [this message]
2013-04-25 14:32     ` Laurentiu Palcu

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=517934DE.90303@windriver.com \
    --to=mark.hatle@windriver.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