| Summary: | do_install_ptest_base doesn't behave as expected if the host is ubuntu (dash) | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Chen Qi <Qi.Chen> |
| Component: | core | Assignee: | Chen Qi <Qi.Chen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium | CC: | bjst, liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, mihai.prica, sgw, yi.zhao |
| Version: | 1.5 | ||
| Target Milestone: | 1.5 M5 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
Branch: master Commit: d5a4f031b460437e9501e4e65194ce94d3641130 URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d5a4f031b460437e9501e4e65194ce94d3641130 |
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