Openembedded Core Discussions
 help / color / mirror / Atom feed
From: ChenQi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/2] ptest.bbclass: fix error on ubuntu host
Date: Thu, 5 Sep 2013 21:41:50 +0800	[thread overview]
Message-ID: <52288A1E.6000808@windriver.com> (raw)
In-Reply-To: <c425dc883150a2c69a92feae459545086e264ac9.1378385266.git.Qi.Chen@windriver.com>

Just noticed the do_configure_ptest_base and do_compile_ptest_base also 
have this problem.

I'll send out a new patchset.

//Chen Qi

On 09/05/2013 08:49 PM, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> The do_install_ptest_base function uses 'type -t' command to check
> whether do_install_ptest is a function and acts correspondingly.
>
> However, the 'type' command is a shell builtin and its behavior is
> not all the same across Linux distros. On ubuntu, if we use #!/bin/sh
> as the interpreter for the scripts, as in the case of our intermediate
> scripts, the '-t' option for the 'type' command is not supported. So
> the check always fails and the do_install_ptest function, even if defined,
> is not run.
>
> This patch fixes this problem by avoiding using the 'type' builtin command.
>
> [YOCTO #5128]
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   meta/classes/ptest.bbclass |    8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
> index 37357e8..71183af 100644
> --- a/meta/classes/ptest.bbclass
> +++ b/meta/classes/ptest.bbclass
> @@ -32,6 +32,10 @@ do_compile_ptest_base() {
>       fi
>   }
>   
> +do_install_ptest() {
> +    :
> +}
> +
>   do_install_ptest_base() {
>       if [ ${PTEST_ENABLED} = 1 ]; then
>           if [ -f ${WORKDIR}/run-ptest ]; then
> @@ -39,9 +43,7 @@ do_install_ptest_base() {
>               if grep -q install-ptest: Makefile; then
>                   oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
>               fi
> -            if [ a$(type -t do_install_ptest) = afunction ]; then
> -                do_install_ptest
> -            fi
> +            do_install_ptest
>           fi
>       fi
>   }



  reply	other threads:[~2013-09-05 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-05 12:49 [PATCH 0/2] ptest: add cleandirs flag and fix error on ubuntu host Qi.Chen
2013-09-05 12:49 ` [PATCH 1/2] ptest.bbclass: " Qi.Chen
2013-09-05 13:41   ` ChenQi [this message]
2013-09-05 12:49 ` [PATCH 2/2] ptest.bbclass: add cleandirs flag to do_install_ptest_base Qi.Chen

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=52288A1E.6000808@windriver.com \
    --to=qi.chen@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