Bug 5128 - do_install_ptest_base doesn't behave as expected if the host is ubuntu (dash)
Summary: do_install_ptest_base doesn't behave as expected if the host is ubuntu (dash)
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.5
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.5 M5
Assignee: Chen Qi
QA Contact:
URL:
Whiteboard:
: 5111 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-05 11:12 UTC by Chen Qi
Modified: 2013-09-11 23:17 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Qi 2013-09-05 11:12:59 UTC
The related code snippet is:

            if [ a$(type -t do_install_ptest) = afunction ]; then
                do_install_ptest
            fi

However, if the host is ubuntu, the check always fail, thus the do_install_ptest not run.

Actually 'type' is a shell built in, we should avoid using it whenever possible.

A simple example showing that using #!/bin/sh and 'type -t' will fail in ubuntu is shown below.

<code>
#!/bin/sh                                                                                                                                                                                                       
func_wrapper() {
    type -t func
}

func() {
    echo "THIS IS FUNC"
}

func_wrapper
</code>

chenqi@pek-qchen1-d1:~/test$ ./test.sh
-t: not found
func is a shell function

//Chen Qi
Comment 1 Chen Qi 2013-09-11 05:49:37 UTC
Branch: master
Commit: d5a4f031b460437e9501e4e65194ce94d3641130
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d5a4f031b460437e9501e4e65194ce94d3641130
Comment 2 Saul Wold 2013-09-11 23:17:54 UTC
*** Bug 5111 has been marked as a duplicate of this bug. ***