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.
Second on that!
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 :-)
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.
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 :-)
should be fixed in gentoolkit-0.2.0_pre10