summaryrefslogtreecommitdiffstats
path: root/meta/classes/ptest.bbclass
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2013-09-05 13:58:25 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-10 14:57:19 (GMT)
commit8905f7715d175c834c4d0797b2da7366ee2c8ace (patch)
tree510741edfd59f61e6cd680daf5b18bf5b3f271db /meta/classes/ptest.bbclass
parent0ca5d1fb38157564a2b9452ade32391d18a41b09 (diff)
downloadpoky-8905f7715d175c834c4d0797b2da7366ee2c8ace.tar.gz
ptest.bbclass: fix error on ubuntu host
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. The same problem also applies to the do_configure_ptest_base and the do_compile_ptest_base functions. This patch fixes this problem by avoiding using the 'type' builtin command. [YOCTO #5128] (From OE-Core rev: d5a4f031b460437e9501e4e65194ce94d3641130) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/ptest.bbclass')
-rw-r--r--meta/classes/ptest.bbclass24
1 files changed, 15 insertions, 9 deletions
diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index 37357e8..15a42d6 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -16,22 +16,30 @@ RDEPENDS_${PN}-ptest_virtclass-nativesdk = ""
16 16
17PACKAGES =+ "${@base_contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}" 17PACKAGES =+ "${@base_contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
18 18
19do_configure_ptest() {
20 :
21}
22
19do_configure_ptest_base() { 23do_configure_ptest_base() {
20 if [ ${PTEST_ENABLED} = 1 ]; then 24 if [ ${PTEST_ENABLED} = 1 ]; then
21 if [ a$(type -t do_configure_ptest) = afunction ]; then 25 do_configure_ptest
22 do_configure_ptest
23 fi
24 fi 26 fi
25} 27}
26 28
29do_compile_ptest() {
30 :
31}
32
27do_compile_ptest_base() { 33do_compile_ptest_base() {
28 if [ ${PTEST_ENABLED} = 1 ]; then 34 if [ ${PTEST_ENABLED} = 1 ]; then
29 if [ a$(type -t do_compile_ptest) = afunction ]; then 35 do_compile_ptest
30 do_compile_ptest
31 fi
32 fi 36 fi
33} 37}
34 38
39do_install_ptest() {
40 :
41}
42
35do_install_ptest_base() { 43do_install_ptest_base() {
36 if [ ${PTEST_ENABLED} = 1 ]; then 44 if [ ${PTEST_ENABLED} = 1 ]; then
37 if [ -f ${WORKDIR}/run-ptest ]; then 45 if [ -f ${WORKDIR}/run-ptest ]; then
@@ -39,9 +47,7 @@ do_install_ptest_base() {
39 if grep -q install-ptest: Makefile; then 47 if grep -q install-ptest: Makefile; then
40 oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest 48 oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
41 fi 49 fi
42 if [ a$(type -t do_install_ptest) = afunction ]; then 50 do_install_ptest
43 do_install_ptest
44 fi
45 fi 51 fi
46 fi 52 fi
47} 53}