* [PATCH 0/2] ptest: add cleandirs flag and fix error on ubuntu host
@ 2013-09-05 12:49 Qi.Chen
2013-09-05 12:49 ` [PATCH 1/2] ptest.bbclass: " Qi.Chen
2013-09-05 12:49 ` [PATCH 2/2] ptest.bbclass: add cleandirs flag to do_install_ptest_base Qi.Chen
0 siblings, 2 replies; 4+ messages in thread
From: Qi.Chen @ 2013-09-05 12:49 UTC (permalink / raw)
To: openembedded-core
From: Chen Qi <Qi.Chen@windriver.com>
The following changes since commit f41b7a7d4d0463a0dfafe6621d01680b81798019:
bitbake: hob: remove PACKAGE_INSTALL variable setting from hob (2013-09-04 14:18:49 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/ptest-dash
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/ptest-dash
Chen Qi (2):
ptest.bbclass: fix error on ubuntu host
ptest.bbclass: add cleandirs flag to do_install_ptest_base
meta/classes/ptest.bbclass | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ptest.bbclass: fix error on ubuntu host
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 ` Qi.Chen
2013-09-05 13:41 ` ChenQi
2013-09-05 12:49 ` [PATCH 2/2] ptest.bbclass: add cleandirs flag to do_install_ptest_base Qi.Chen
1 sibling, 1 reply; 4+ messages in thread
From: Qi.Chen @ 2013-09-05 12:49 UTC (permalink / raw)
To: openembedded-core
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
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ptest.bbclass: add cleandirs flag to do_install_ptest_base
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 12:49 ` Qi.Chen
1 sibling, 0 replies; 4+ messages in thread
From: Qi.Chen @ 2013-09-05 12:49 UTC (permalink / raw)
To: openembedded-core
From: Chen Qi <Qi.Chen@windriver.com>
The do_install_ptest_base task should have cleandirs flag, just like
the do_install task. The ${D}${PTEST_PATH} directory should be cleaned,
Otherwise, there would be similar errors like below if the
do_install_ptest_base task is rerun.
ln: failed to create symbolic link `xxx': File exists
[YOCTO #5129]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/classes/ptest.bbclass | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index 71183af..188afcd 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -48,6 +48,8 @@ do_install_ptest_base() {
fi
}
+do_install_ptest_base[cleandirs] = "${D}${PTEST_PATH}"
+
addtask configure_ptest_base after do_configure before do_compile
addtask compile_ptest_base after do_compile before do_install
addtask install_ptest_base after do_install before do_package
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ptest.bbclass: fix error on ubuntu host
2013-09-05 12:49 ` [PATCH 1/2] ptest.bbclass: " Qi.Chen
@ 2013-09-05 13:41 ` ChenQi
0 siblings, 0 replies; 4+ messages in thread
From: ChenQi @ 2013-09-05 13:41 UTC (permalink / raw)
To: openembedded-core
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
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-05 13:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-09-05 12:49 ` [PATCH 2/2] ptest.bbclass: add cleandirs flag to do_install_ptest_base Qi.Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox