<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 4, 2013 at 2:27 AM, Robert Yang <span dir="ltr">&lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1a0">The bb.process.run() will return one tuple, e.g:<br>
<br>
p4file = (&#39;strA\nStrB\nstrC\n&#39;), then there will be an iteration on p4file:<br>
<br>
for i in p4file:<br>
        [snip]<br>
<br>
The i will be &#39;s t r A ...&#39;, this is incorrect. use:<br>
<br>
p4file = p4file.splitlines()<br>
<br>
will fix the problem.<br>
<br>
[YOCTO #3619]<br>
<br>
Signed-off-by: Robert Yang &lt;<a href="mailto:liezhi.yang@windriver.com">liezhi.yang@windriver.com</a>&gt;<br>
---<br>
<div class="im"> bitbake/lib/bb/fetch2/perforce.py | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
</div>diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py<br>
index df3a3a3..86ec9ba 100644<br>
--- a/bitbake/lib/bb/fetch2/perforce.py<br>
+++ b/bitbake/lib/bb/fetch2/perforce.py<br>
@@ -170,7 +170,7 @@ class Perforce(FetchMethod):<br>
         <a href="http://logger.info" target="_blank">logger.info</a>(&quot;Fetch &quot; + loc)<br>
         <a href="http://logger.info" target="_blank">logger.info</a>(&quot;%s%s files %s&quot;, p4cmd, p4opt, depot)<br>
         p4file, errors = bb.process.run(&quot;%s%s files %s&quot; % (p4cmd, p4opt, depot))<br>
-        p4file = p4file.strip()<br>
+        p4file = p4file.splitlines()</div></blockquote></div><br>Note that splitlines doesn&#39;t chop off the trailing newlines from the individual strings. It *probably* wont cause an issue in this case due to how it&#39;s passed to the shell in the subsequent subprocess call, but from a correctness standpoint, I&#39;d suggest changing this to something like p4files = [f.rstrip() for f in p4file.splitlines], or doing an rstrip on the individual files in the later iteration.<br>

-- <br>Christopher Larson</div></div>