Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] repoman: mark errors with explicit '[fatal']
Date: Tue, 10 Feb 2015 23:53:57
Message-Id: 1423612347-10908-1-git-send-email-mgorny@gentoo.org
1 Mark fatal check results with explicit '[fatal]' marker to ease grepping
2 and provide the additional information on non-colorful terminals
3 as well.
4 ---
5 pym/repoman/utilities.py | 9 ++++++---
6 1 file changed, 6 insertions(+), 3 deletions(-)
7
8 diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
9 index 4f01aa7..a2535f0 100644
10 --- a/pym/repoman/utilities.py
11 +++ b/pym/repoman/utilities.py
12 @@ -310,15 +310,18 @@ def format_qa_output(formatter, stats, fails, dofull, dofail, options, qawarning
13 # we only want key value pairs where value > 0
14 for category, number in \
15 filter(lambda myitem: myitem[1] > 0, sorted(stats.items())):
16 - formatter.add_literal_data(" " + category.ljust(30))
17 + formatter.add_literal_data(" " + category)
18 + spacing_width = 30 - len(category)
19 if category in qawarnings:
20 formatter.push_style("WARN")
21 else:
22 formatter.push_style("BAD")
23 + formatter.add_literal_data(" [fatal]")
24 + spacing_width -= 8
25 +
26 + formatter.add_literal_data(" " * spacing_width)
27 formatter.add_literal_data("%s" % number)
28 formatter.pop_style()
29 - if category not in qawarnings:
30 - formatter.add_literal_data(" [fatal]")
31 formatter.add_line_break()
32 if not dofull:
33 if not full and dofail and category in qawarnings:
34 --
35 2.3.0

Replies