[oe-commits] Chen Qi : ptest.bbclass: fix error on ubuntu host

git at git.openembedded.org git at git.openembedded.org
Tue Sep 10 14:45:37 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: d5a4f031b460437e9501e4e65194ce94d3641130
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d5a4f031b460437e9501e4e65194ce94d3641130

Author: Chen Qi <Qi.Chen at windriver.com>
Date:   Thu Sep  5 13:58:25 2013 +0000

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]

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/ptest.bbclass |   24 +++++++++++++++---------
 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 = ""
 
 PACKAGES =+ "${@base_contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
 
+do_configure_ptest() {
+    :
+}
+
 do_configure_ptest_base() {
     if [ ${PTEST_ENABLED} = 1 ]; then
-        if [ a$(type -t do_configure_ptest) = afunction ]; then
-            do_configure_ptest
-        fi
+        do_configure_ptest
     fi
 }
 
+do_compile_ptest() {
+    :
+}
+
 do_compile_ptest_base() {
     if [ ${PTEST_ENABLED} = 1 ]; then
-        if [ a$(type -t do_compile_ptest) = afunction ]; then
-            do_compile_ptest
-        fi
+        do_compile_ptest
     fi
 }
 
+do_install_ptest() {
+    :
+}
+
 do_install_ptest_base() {
     if [ ${PTEST_ENABLED} = 1 ]; then
         if [ -f ${WORKDIR}/run-ptest ]; then
@@ -39,9 +47,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
 }



More information about the Openembedded-commits mailing list