<div dir="ltr"><div>Dear <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Paul and all,</span></div><div dir="auto"><br></div><div dir="auto">Thanks for your reply.</div><div>1) OK. I will follow the &quot;Commit Patch Message Guidelines&quot; and revise my patch.</div><div>2) I am sorry that I forgot to consider the licensing issue.</div><div>    I will remove these codes in my revised 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">patch</span>.</div><div>3) I totally agree with you. It&#39;s awesome to use<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">&quot;/usr/bin/env &lt;command&gt; &lt;options&gt;&quot;<span> right here.</span></span></span></div><br><div class="gmail_quote"><div dir="ltr">Paul Eggleton &lt;<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@linux.intel.com</a><wbr>&gt; 於 2018年5月21日週一 12:13 寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
Thanks for the patch. A few comments:<br>
<br>
1) All patches need to have Signed-off-by and a proper commit message. Please <br>
refer to: <a href="http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines" rel="noreferrer noreferrer" target="_blank">http://www.openembedded.org/<wbr>wiki/Commit_Patch_Message_<wbr>Guidelines</a><br>
<br>
2) We shouldn&#39;t be copying in functions verbatim from Python, that&#39;s <br>
potentially problematic for licensing reasons if nothing else.<br>
<br>
3) I wonder, is this even necessary? It should be searching PATH already, thus <br>
we should be able to just put the name of the executable we want to run <br>
without needing to find the full path. Looking at the other fetcher modules we <br>
typically use &quot;/usr/bin/env &lt;command&gt; &lt;options&gt;&quot; so I think that should work <br>
here as well.<br>
<br>
Cheers,<br>
Paul<br>
<br>
On Monday, 21 May 2018 2:51:52 AM NZST Tzu Hsiang Lin wrote:<br>
&gt; ---<br>
&gt;  lib/bb/fetch2/clearcase.py | 28 ++++++++++++++++++++++++++--<br>
&gt;  lib/bb/fetch2/npm.py       |  1 -<br>
&gt;  2 files changed, 26 insertions(+), 3 deletions(-)<br>
&gt; <br>
&gt; diff --git a/lib/bb/fetch2/clearcase.py b/lib/bb/fetch2/clearcase.py<br>
&gt; index 36beab6a..28589dbc 100644<br>
&gt; --- a/lib/bb/fetch2/clearcase.py<br>
&gt; +++ b/lib/bb/fetch2/clearcase.py<br>
&gt; @@ -69,7 +69,6 @@ from   bb.fetch2 import FetchMethod<br>
&gt;  from   bb.fetch2 import FetchError<br>
&gt;  from   bb.fetch2 import runfetchcmd<br>
&gt;  from   bb.fetch2 import logger<br>
&gt; -from   distutils import spawn<br>
&gt;  <br>
&gt;  class ClearCase(FetchMethod):<br>
&gt;      &quot;&quot;&quot;Class to fetch urls via &#39;clearcase&#39;&quot;&quot;&quot;<br>
&gt; @@ -107,7 +106,7 @@ class ClearCase(FetchMethod):<br>
&gt;          else:<br>
&gt;              ud.module = &quot;&quot;<br>
&gt;  <br>
&gt; -        ud.basecmd = d.getVar(&quot;FETCHCMD_ccrc&quot;) or <br>
spawn.find_executable(&quot;<wbr>cleartool&quot;) or spawn.find_executable(&quot;<wbr>rcleartool&quot;)<br>
&gt; +        ud.basecmd = d.getVar(&quot;FETCHCMD_ccrc&quot;) or <br>
_find_executable(&quot;cleartool&quot;) or _find_executable(&quot;rcleartool&quot;)<br>
&gt;  <br>
&gt;          if d.getVar(&quot;SRCREV&quot;) == &quot;INVALID&quot;:<br>
&gt;            raise FetchError(&quot;Set a valid SRCREV for the clearcase fetcher in <br>
your recipe, e.g. SRCREV = \&quot;/main/LATEST\&quot; or any other label of your <br>
choice.&quot;)<br>
&gt; @@ -207,6 +206,31 @@ class ClearCase(FetchMethod):<br>
&gt;              output = runfetchcmd(cmd, d, workdir=ud.ccasedir)<br>
&gt;              <a href="http://logger.info" rel="noreferrer noreferrer" target="_blank">logger.info</a>(&quot;rmview output: %s&quot;, output)<br>
&gt;  <br>
&gt; +    def _find_executable(executable, path=None):<br>
&gt; +        &quot;&quot;&quot;Tries to find &#39;executable&#39; in the directories listed in &#39;path&#39;.<br>
&gt; +<br>
&gt; +        A string listing directories separated by &#39;os.pathsep&#39;; defaults to<br>
&gt; +        os.environ[&#39;PATH&#39;].  Returns the complete filename or None if not <br>
found.<br>
&gt; +        &quot;&quot;&quot;<br>
&gt; +        if path is None:<br>
&gt; +            path = os.environ[&#39;PATH&#39;]<br>
&gt; +<br>
&gt; +        paths = path.split(os.pathsep)<br>
&gt; +        base, ext = os.path.splitext(executable)<br>
&gt; +<br>
&gt; +        if (sys.platform == &#39;win32&#39;) and (ext != &#39;.exe&#39;):<br>
&gt; +            executable = executable + &#39;.exe&#39;<br>
&gt; +<br>
&gt; +        if not os.path.isfile(executable):<br>
&gt; +            for p in paths:<br>
&gt; +                f = os.path.join(p, executable)<br>
&gt; +                if os.path.isfile(f):<br>
&gt; +                    # the file exists, we have a shot at spawn working<br>
&gt; +                    return f<br>
&gt; +            return None<br>
&gt; +        else:<br>
&gt; +            return executable<br>
&gt; +<br>
&gt;      def need_update(self, ud, d):<br>
&gt;          if (&quot;LATEST&quot; in ud.label) or (ud.customspec and &quot;LATEST&quot; in <br>
ud.customspec):<br>
&gt;              ud.identifier += &quot;-%s&quot; % d.getVar(&quot;DATETIME&quot;,d, True)<br>
&gt; diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py<br>
&gt; index 730c346a..408dfc3d 100644<br>
&gt; --- a/lib/bb/fetch2/npm.py<br>
&gt; +++ b/lib/bb/fetch2/npm.py<br>
&gt; @@ -32,7 +32,6 @@ from   bb.fetch2 import runfetchcmd<br>
&gt;  from   bb.fetch2 import logger<br>
&gt;  from   bb.fetch2 import UnpackError<br>
&gt;  from   bb.fetch2 import ParameterError<br>
&gt; -from   distutils import spawn<br>
&gt;  <br>
&gt;  def subprocess_setup():<br>
&gt;      # Python installs a SIGPIPE handler by default. This is usually not <br>
what<br>
&gt; <br>
<br>
<br>
-- <br>
<br>
Paul Eggleton<br>
Intel Open Source Technology Centre<br>
<br>
<br>
</blockquote></div></div>