<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5128</bug_id>
          
          <creation_ts>2013-09-05 11:12:59 +0000</creation_ts>
          <short_desc>do_install_ptest_base doesn&apos;t behave as expected if the host is ubuntu (dash)</short_desc>
          <delta_ts>2013-09-11 23:17:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chen Qi">Qi.Chen</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>bjst</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>mihai.prica</cc>
    
    <cc>sgw</cc>
    
    <cc>yi.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36329</commentid>
    <comment_count>0</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-09-05 11:12:59 +0000</bug_when>
    <thetext>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 &apos;type&apos; is a shell built in, we should avoid using it whenever possible.

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

&lt;code&gt;
#!/bin/sh                                                                                                                                                                                                       
func_wrapper() {
    type -t func
}

func() {
    echo &quot;THIS IS FUNC&quot;
}

func_wrapper
&lt;/code&gt;

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

//Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36514</commentid>
    <comment_count>1</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-09-11 05:49:37 +0000</bug_when>
    <thetext>Branch: master
Commit: d5a4f031b460437e9501e4e65194ce94d3641130
URL:    http://git.openembedded.org/?p=openembedded-core.git&amp;a=commit;h=d5a4f031b460437e9501e4e65194ce94d3641130</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36564</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2013-09-11 23:17:54 +0000</bug_when>
    <thetext>*** Bug 5111 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>