1 |
Il giorno mer 29 set 2021 alle ore 23:52 A Schenck <lane_andrew@×××××××.com> |
2 |
ha scritto: |
3 |
|
4 |
> On 9/28/21 8:36 AM, Michał Górny wrote: |
5 |
> > Hi, everyone. |
6 |
> > |
7 |
> > I know I'm going to regret asking this... but I've prepared a change to |
8 |
> > the Portage output format and I think it asks for a wider discussion |
9 |
> > than internally in Portage team. |
10 |
> > |
11 |
> > The primary problem with the current output format is that different |
12 |
> > kinds of messages differ only in color. This makes them |
13 |
> > indistinguishable without colors and hard to grep. ago's been asking |
14 |
> > for a better way to grep for QA warnings and this is pretty much what |
15 |
> > motivated me to do this. |
16 |
> > |
17 |
> > The proposed new format distinguished message types both using colors |
18 |
> > and strings. This is roughly inspired by Xorg logs. For example, |
19 |
> > instead of: |
20 |
> > |
21 |
> > * some message |
22 |
> > * other message |
23 |
> > * hell if i know what this is |
24 |
> > |
25 |
> > You get: |
26 |
> > |
27 |
> > [WW] some message |
28 |
> > [EE] other message |
29 |
> > [QA] hell if i know what this is |
30 |
> > |
31 |
> > I've also added more colors to explicitly distinguish einfo from elog, |
32 |
> > and ewarn from eqawarn. Then, I've replaced most of '>>>' and '!!!' |
33 |
> > used by Portage with four-character versions to keep messages aligned. |
34 |
> > The 'zings' used for merging files remain three-character, so now it's |
35 |
> > easily possible to distinguish messages from installed file list. |
36 |
> |
37 |
> Didn't expect to be the only dissenting opinion on something like this |
38 |
> but. . . Some applications parse portage output looking for these |
39 |
> 'zings'. At very least app-portage/kuroo does it this way; there must be |
40 |
> others, right? This is obviously not the ideal way to get information |
41 |
> out of portage, but it's been stable for the 15 years Kuroo has existed. |
42 |
> 10-ish years ago dol-sen started some work on building and API for |
43 |
> portage, but then got sucked into core portage development to the point |
44 |
> of abandoning their GTK+ portage GUI porthole, which was the original |
45 |
> impetus for an API, and as far as we know, the API never made it to the |
46 |
> point it could replace parsing the output. |
47 |
> |
48 |
> It wouldn't be worth blocking progress for one application that not many |
49 |
> people use, but assuming there are others that will also break with this |
50 |
> change. Are we sure there's no way to support ago's (very valuable) work |
51 |
> without breaking other things? |
52 |
> |
53 |
> -A |
54 |
> |
55 |
|
56 |
Kuroo is already a quite complex application that parse portage output. A |
57 |
quick grep seems to show that changes needed are quite manageable. |
58 |
Also the parsing should be more accurate with proposed changes. |
59 |
Rather it should be easy for the application to know in advance which |
60 |
format the output will be. |
61 |
There is also the opportunity to have a flag that enable (or disable) the |
62 |
augmented output, but IMHO this should be done only if the added complexity |
63 |
is NIL |
64 |
|
65 |
$ grep -c -Ers 'QRegExp |QregularExpression ' -i kuroo-1.2.1 | grep -v |
66 |
:0$ |
67 |
kuroo-1.2.1/TODO:1 |
68 |
kuroo-1.2.1/src/history/history.cpp:3 |
69 |
kuroo-1.2.1/src/config/configdialog.h:2 |
70 |
kuroo-1.2.1/src/queue/queuelistview.cpp:1 |
71 |
kuroo-1.2.1/src/core/scanupdatesjob.cpp:1 |
72 |
kuroo-1.2.1/src/core/global.h:2 |
73 |
kuroo-1.2.1/src/core/packageinspector.cpp:4 |
74 |
kuroo-1.2.1/src/core/packageversion.h:2 |
75 |
kuroo-1.2.1/src/core/etcupdate.h:1 |
76 |
kuroo-1.2.1/src/core/portagedb.cpp:2 |
77 |
kuroo-1.2.1/src/core/scanhistoryjob.cpp:3 |
78 |
kuroo-1.2.1/src/core/global.cpp:1 |
79 |
kuroo-1.2.1/src/core/dependatom.h:2 |
80 |
kuroo-1.2.1/src/core/emerge.cpp:8 |
81 |
|
82 |
|
83 |
|
84 |
|
85 |
> |
86 |
> > |
87 |
> > The PR doing this is: https://github.com/gentoo/portage/pull/759 |
88 |
> > |
89 |
> > Example screenshot: |
90 |
> > |
91 |
> https://user-images.githubusercontent.com/110765/135119090-16e9599d-1b0f-41b8-a965-a55577183ffd.png |
92 |
> > |
93 |
> |
94 |
> |