diff --git a/lib/bb/progress.py b/lib/bb/progress.py index d051ba0198..52d704d642 100644 --- a/lib/bb/progress.py +++ b/lib/bb/progress.py @@ -94,12 +94,15 @@ def write(self, string): while True: breakpos = self._linebuffer.find('\n') + 1 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] self._linebuffer = self._linebuffer[breakpos:] # Drop any line feeds and anything that precedes them lbreakpos = line.rfind('\r') + 1 - if lbreakpos: + if lbreakpos and lbreakpos != breakpos: line = line[lbreakpos:] if self.writeline(filter_color(line)): super().write(line)