Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 47953 - glsa-check could use some colors
Summary: glsa-check could use some colors
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-04-15 12:32 UTC by Frido Ferdinand
Modified: 2004-10-10 15:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
glsa-check: add color,better status presentation, new option (glsa-check-colorize.diff,3.42 KB, patch)
2004-06-15 09:08 UTC, Kalin KOZHUHAROV
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frido Ferdinand 2004-04-15 12:32:27 UTC
glsa-check output could use some extra colours :)

a simple:

sys.path.append("/usr/lib/portage/pym")
from output import *

and:

                if myglsa.isApplied():
                        status = "[%s]" % (yellow("A"))
                elif myglsa.isVulnerable():
                        status = "[%s]" % (red("N"))
                else:
                        status = "[%s]" % (green("U"))

makes for a more pleasant reading :)

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Kalin KOZHUHAROV 2004-06-15 07:56:35 UTC
Second on that!
Comment 2 Kalin KOZHUHAROV 2004-06-15 08:12:21 UTC
And while I am at it (pressed Commit too quick...),

what about an option to list only the "possibly affected" GLSAs?
I usually use the command below, but there should be better way:
glsa-check -l 2>/dev/null|grep '\[N\]'

Are you considering other than [A][U][N] for designating the status of a given GLSA?
I still keep on forgetting that N is not-affected and not not-applied.
My personal preference will be:
green OK
red !!
yellow or grey or even dark green NA (aa, let me see again what was it...) for not-affected

so [A]->[OK], [U]->[NA], [N]->[!!] all colorfull.

And now if you tell me that this is not more close to the mind (analogy of init.d scrips?).

I prefer perls than big snakes, but might have a look at code right now :-)
Comment 3 Kalin KOZHUHAROV 2004-06-15 09:08:44 UTC
Created attachment 33317 [details, diff]
glsa-check: add color,better status presentation, new option

Plese check the first few lines for module inclusion, no idea what they do
(copied them from the previous poster).

This patch adds:
1. Colorize the output
   we need a way to turn it off when not on tty (as emerge does), I thought
that will happen automagically.
   more colors for the GLSA number? make it lila :-)

2. New option --show (-s)
   shows only dangerous packages (t.e. the ones that might need GLSA applied)

3. Comment that only one option should be used
   it shows this anyway when you try to use two (like --pretend --fix)

That ws my first touch with Python, so DO look at the code.
Comment 4 Kalin KOZHUHAROV 2004-06-15 09:15:30 UTC
Of course... forgot something.

The color in the help messeges, etc :-(

Which comes to a point that these status codes should be defined in a single place in the code, together with the optional color. At the moment the dangerous status is defined in 3 places.

But as I said, a don't understand Python. Dfine it in a global hash or something.

Sorry for the spam till now :-)
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2004-10-10 15:57:39 UTC
should be fixed in gentoolkit-0.2.0_pre10