Bug 3619 - Perforce fetch is broken
Summary: Perforce fetch is broken
Status: VERIFIED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: All Multiple
: Medium+ major
Target Milestone: 1.4 M5
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-12-19 06:38 UTC by Levi Pearson
Modified: 2013-03-08 06:39 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Pearson 2012-12-19 06:38:28 UTC
The breaking change is here: http://git.yoctoproject.org/cgit.cgi/poky/commit/bitbake/lib/bb/fetch2/perforce.py?id=094742bed2fc01d55f572da946fcfa7a48521401

The author of the patch misunderstood the code; the split() was not intended to break the file stream into lines; it was intended to split a single line at whitespace for some p4-specific formatting. 

The 'for file in p4file:' line is what split the stream into lines, since iterating over a file handle yields lines, but now it is broken due to operating on a string instead of a file stream handle.

A possible fix would be something to the effect of 'for file in p4file.splitlines():' or on an earlier line, 'p4file = p4file.splitlines()'.  I added a change like this and it fixed it for me.
Comment 2 Yi Zhao 2013-03-08 06:39:53 UTC
Verified with master branch: d823759b4594143d522eae0b2a2498436a6dcb1e