Gentoo Archives: gentoo-portage-dev

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