<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"><<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>></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 = ('strA\nStrB\nstrC\n'), then there will be an iteration on p4file:<br>
<br>
for i in p4file:<br>
[snip]<br>
<br>
The i will be 's t r A ...', 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 <<a href="mailto:liezhi.yang@windriver.com">liezhi.yang@windriver.com</a>><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>("Fetch " + loc)<br>
<a href="http://logger.info" target="_blank">logger.info</a>("%s%s files %s", p4cmd, p4opt, depot)<br>
p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt, depot))<br>
- p4file = p4file.strip()<br>
+ p4file = p4file.splitlines()</div></blockquote></div><br>Note that splitlines doesn't chop off the trailing newlines from the individual strings. It *probably* wont cause an issue in this case due to how it's passed to the shell in the subsequent subprocess call, but from a correctness standpoint, I'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>