mirror of
https://xff.cz/git/u-boot/
synced 2025-09-20 10:02:07 +02:00
buildman: Refactor error-line output int a function
Reduce the amount of repeated code by creating an _OutputErrLines() function to hold this code. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -1209,6 +1209,20 @@ class Builder:
|
|||||||
col = self.col.YELLOW
|
col = self.col.YELLOW
|
||||||
Print(' ' + line, newline=True, colour=col)
|
Print(' ' + line, newline=True, colour=col)
|
||||||
|
|
||||||
|
def _OutputErrLines(err_lines, colour):
|
||||||
|
"""Output the line of error/warning lines, if not empty
|
||||||
|
|
||||||
|
Also increments self._error_lines if err_lines not empty
|
||||||
|
|
||||||
|
Args:
|
||||||
|
err_lines: List of strings, each an error or warning line,
|
||||||
|
possibly including a list of boards with that error/warning
|
||||||
|
colour: Colour to use for output
|
||||||
|
"""
|
||||||
|
if err_lines:
|
||||||
|
Print('\n'.join(err_lines), colour=colour)
|
||||||
|
self._error_lines += 1
|
||||||
|
|
||||||
|
|
||||||
ok_boards = [] # List of boards fixed since last commit
|
ok_boards = [] # List of boards fixed since last commit
|
||||||
warn_boards = [] # List of boards with warnings since last commit
|
warn_boards = [] # List of boards with warnings since last commit
|
||||||
@@ -1239,7 +1253,7 @@ class Builder:
|
|||||||
else:
|
else:
|
||||||
new_boards.append(target)
|
new_boards.append(target)
|
||||||
|
|
||||||
# Get a list of errors that have appeared, and disappeared
|
# Get a list of errors and warnings that have appeared, and disappeared
|
||||||
better_err, worse_err = _CalcErrorDelta(self._base_err_lines,
|
better_err, worse_err = _CalcErrorDelta(self._base_err_lines,
|
||||||
self._base_err_line_boards, err_lines, err_line_boards, '')
|
self._base_err_line_boards, err_lines, err_line_boards, '')
|
||||||
better_warn, worse_warn = _CalcErrorDelta(self._base_warn_lines,
|
better_warn, worse_warn = _CalcErrorDelta(self._base_warn_lines,
|
||||||
@@ -1262,18 +1276,10 @@ class Builder:
|
|||||||
for arch, target_list in arch_list.items():
|
for arch, target_list in arch_list.items():
|
||||||
Print('%10s: %s' % (arch, target_list))
|
Print('%10s: %s' % (arch, target_list))
|
||||||
self._error_lines += 1
|
self._error_lines += 1
|
||||||
if better_err:
|
_OutputErrLines(better_err, colour=self.col.GREEN)
|
||||||
Print('\n'.join(better_err), colour=self.col.GREEN)
|
_OutputErrLines(worse_err, colour=self.col.RED)
|
||||||
self._error_lines += 1
|
_OutputErrLines(better_warn, colour=self.col.CYAN)
|
||||||
if worse_err:
|
_OutputErrLines(worse_warn, colour=self.col.MAGENTA)
|
||||||
Print('\n'.join(worse_err), colour=self.col.RED)
|
|
||||||
self._error_lines += 1
|
|
||||||
if better_warn:
|
|
||||||
Print('\n'.join(better_warn), colour=self.col.CYAN)
|
|
||||||
self._error_lines += 1
|
|
||||||
if worse_warn:
|
|
||||||
Print('\n'.join(worse_warn), colour=self.col.MAGENTA)
|
|
||||||
self._error_lines += 1
|
|
||||||
|
|
||||||
if show_sizes:
|
if show_sizes:
|
||||||
self.PrintSizeSummary(board_selected, board_dict, show_detail,
|
self.PrintSizeSummary(board_selected, board_dict, show_detail,
|
||||||
|
Reference in New Issue
Block a user