From: Robert Yang <liezhi.yang@windriver.com>
To: Chris Larson <clarson@kergoth.com>
Cc: "bitbake-devel@lists.openembedded.org"
<bitbake-devel@lists.openembedded.org>,
Zhenfeng.Zhao@windriver.com
Subject: Re: [PATCH 1/1] perforce.py: fix the perforce fetcher
Date: Tue, 5 Feb 2013 10:36:09 +0800 [thread overview]
Message-ID: <51107019.2070509@windriver.com> (raw)
In-Reply-To: <CABcZAN=g5073uzZ_nu4Q585_BXmEiSTDcjZwQs4RvWQVhde1eA@mail.gmail.com>
Hi Chris,
Thank you very much, I've updated the pull request:
git://git.pokylinux.org/poky-contrib robert/p4
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=robert/p4
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py
index df3a3a3..fc4074d 100644
--- a/bitbake/lib/bb/fetch2/perforce.py
+++ b/bitbake/lib/bb/fetch2/perforce.py
@@ -170,7 +170,7 @@ class Perforce(FetchMethod):
logger.info("Fetch " + loc)
logger.info("%s%s files %s", p4cmd, p4opt, depot)
p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt, depot))
- p4file = p4file.strip()
+ p4file = [f.rstrip() for f in p4file.splitlines()]
if not p4file:
raise FetchError("Fetch: unable to get the P4 files from %s" %
depot, loc)
// Robert
On 02/04/2013 11:46 PM, Chris Larson wrote:
> On Mon, Feb 4, 2013 at 2:27 AM, Robert Yang <liezhi.yang@windriver.com>wrote:
>
>> The bb.process.run() will return one tuple, e.g:
>>
>> p4file = ('strA\nStrB\nstrC\n'), then there will be an iteration on p4file:
>>
>> for i in p4file:
>> [snip]
>>
>> The i will be 's t r A ...', this is incorrect. use:
>>
>> p4file = p4file.splitlines()
>>
>> will fix the problem.
>>
>> [YOCTO #3619]
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>> bitbake/lib/bb/fetch2/perforce.py | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bitbake/lib/bb/fetch2/perforce.py
>> b/bitbake/lib/bb/fetch2/perforce.py
>> index df3a3a3..86ec9ba 100644
>> --- a/bitbake/lib/bb/fetch2/perforce.py
>> +++ b/bitbake/lib/bb/fetch2/perforce.py
>> @@ -170,7 +170,7 @@ class Perforce(FetchMethod):
>> logger.info("Fetch " + loc)
>> logger.info("%s%s files %s", p4cmd, p4opt, depot)
>> p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt,
>> depot))
>> - p4file = p4file.strip()
>> + p4file = p4file.splitlines()
>>
>
> 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.
>
prev parent reply other threads:[~2013-02-05 2:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 9:27 [PATCH 0/1] perforce.py: fix the perforce fetcher Robert Yang
2013-02-04 9:27 ` [PATCH 1/1] " Robert Yang
2013-02-04 15:46 ` Chris Larson
2013-02-05 2:36 ` Robert Yang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51107019.2070509@windriver.com \
--to=liezhi.yang@windriver.com \
--cc=Zhenfeng.Zhao@windriver.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=clarson@kergoth.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox