diff options
author | Przemyslaw Gorszkowski <przemek.gorszkowski@redembedded.com> | 2021-04-26 09:32:37 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-01 22:51:06 +0100 |
commit | a854068b525877583bbd9c6a32a8dffaf18cb2b5 (patch) | |
tree | a75c782dc31e78886f30d6fb3a530da3bcb19b48 /bitbake | |
parent | 5e8e08df8b5d0040ad911d3c51f63e7fec1858b4 (diff) | |
download | poky-a854068b525877583bbd9c6a32a8dffaf18cb2b5.tar.gz |
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>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/progress.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/progress.py b/bitbake/lib/bb/progress.py index d051ba0198..52d704d642 100644 --- a/bitbake/lib/bb/progress.py +++ b/bitbake/lib/bb/progress.py | |||
@@ -94,12 +94,15 @@ class LineFilterProgressHandler(ProgressHandler): | |||
94 | while True: | 94 | while True: |
95 | breakpos = self._linebuffer.find('\n') + 1 | 95 | breakpos = self._linebuffer.find('\n') + 1 |
96 | if breakpos == 0: | 96 | if breakpos == 0: |
97 | break | 97 | # for the case when the line with progress ends with only '\r' |
98 | breakpos = self._linebuffer.find('\r') + 1 | ||
99 | if breakpos == 0: | ||
100 | break | ||
98 | line = self._linebuffer[:breakpos] | 101 | line = self._linebuffer[:breakpos] |
99 | self._linebuffer = self._linebuffer[breakpos:] | 102 | self._linebuffer = self._linebuffer[breakpos:] |
100 | # Drop any line feeds and anything that precedes them | 103 | # Drop any line feeds and anything that precedes them |
101 | lbreakpos = line.rfind('\r') + 1 | 104 | lbreakpos = line.rfind('\r') + 1 |
102 | if lbreakpos: | 105 | if lbreakpos and lbreakpos != breakpos: |
103 | line = line[lbreakpos:] | 106 | line = line[lbreakpos:] |
104 | if self.writeline(filter_color(line)): | 107 | if self.writeline(filter_color(line)): |
105 | super().write(line) | 108 | super().write(line) |