mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
bitbake: progress: LineFilterProgressHandler - Handle parsing line which ends with CR only
S3 commands need to handle different CR only line endings, update the handler to cope with this. (Bitbake rev: 3f7b9c1b429a4c68240e80832a8ef93ee210e5ff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5e8e08df8b
commit
a854068b52
@@ -94,12 +94,15 @@ class LineFilterProgressHandler(ProgressHandler):
|
|||||||
while True:
|
while True:
|
||||||
breakpos = self._linebuffer.find('\n') + 1
|
breakpos = self._linebuffer.find('\n') + 1
|
||||||
if breakpos == 0:
|
if breakpos == 0:
|
||||||
break
|
# for the case when the line with progress ends with only '\r'
|
||||||
|
breakpos = self._linebuffer.find('\r') + 1
|
||||||
|
if breakpos == 0:
|
||||||
|
break
|
||||||
line = self._linebuffer[:breakpos]
|
line = self._linebuffer[:breakpos]
|
||||||
self._linebuffer = self._linebuffer[breakpos:]
|
self._linebuffer = self._linebuffer[breakpos:]
|
||||||
# Drop any line feeds and anything that precedes them
|
# Drop any line feeds and anything that precedes them
|
||||||
lbreakpos = line.rfind('\r') + 1
|
lbreakpos = line.rfind('\r') + 1
|
||||||
if lbreakpos:
|
if lbreakpos and lbreakpos != breakpos:
|
||||||
line = line[lbreakpos:]
|
line = line[lbreakpos:]
|
||||||
if self.writeline(filter_color(line)):
|
if self.writeline(filter_color(line)):
|
||||||
super().write(line)
|
super().write(line)
|
||||||
|
|||||||
Reference in New Issue
Block a user