Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 33317 Details for
Bug 47953
glsa-check could use some colors
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
glsa-check: add color,better status presentation, new option
glsa-check-colorize.diff (text/plain), 3.42 KB, created by
Kalin KOZHUHAROV
on 2004-06-15 09:08:44 UTC
(
hide
)
Description:
glsa-check: add color,better status presentation, new option
Filename:
MIME Type:
Creator:
Kalin KOZHUHAROV
Created:
2004-06-15 09:08:44 UTC
Size:
3.42 KB
patch
obsolete
>diff -Nru A/gentoolkit-0.2.0_pre8/src/glsa-check/glsa-check B/gentoolkit-0.2.0_pre8/src/glsa-check/glsa-check >--- A/gentoolkit-0.2.0_pre8/src/glsa-check/glsa-check 2004-03-31 15:22:41.000000000 +0900 >+++ B/gentoolkit-0.2.0_pre8/src/glsa-check/glsa-check 2004-06-16 00:51:53.421578490 +0900 >@@ -6,6 +6,8 @@ > import os,string,sys > sys.path.insert(0, "/usr/lib/gentoolkit/pym") > from getopt import getopt,GetoptError >+sys.path.append("/usr/lib/portage/pym") >+from output import * > > __program__ = "glsa-check" > __author__ = "Marius Mauch <genone@gentoo.org>" >@@ -13,6 +15,7 @@ > > optionmap = [ > ["-l", "--list", "list all unapplied GLSA"], >+["-s", "--show", "show which GLSA might need to be applied"], > ["-d", "--dump", "--print", "show all information about the given GLSA"], > ["-t", "--test", "test if this system is affected by the given GLSA"], > ["-p", "--pretend", "show the necessary commands to apply this GLSA"], >@@ -34,8 +37,8 @@ > args = [] > params = [] > try: >- args, params = getopt(sys.argv[1:], "dplfchivt", \ >- ["dump", "print", "list", "pretend", "fix", "inject", "help", "info", "version", "test"]) >+ args, params = getopt(sys.argv[1:], "dplfchivts", \ >+ ["dump", "print", "list", "pretend", "fix", "inject", "help", "info", "version", "test", "show"]) > args = [a for a,b in args] > > # sanity checking >@@ -65,6 +68,8 @@ > mode = "help" > elif len(params) <= 0 and mode == "list": > params.append("new") >+elif len(params) <= 0 and mode == "show": >+ params.append("new") > > # show help message > if mode == "help": >@@ -76,7 +81,8 @@ > for o in m[2:-1]: > print "\t" + o > print >- print "glsa-list can contain an arbitrary number of GLSA ids, " >+ print "<option> can be any SINGLE one from the list above, " >+ print "[glsa-list] can contain an arbitrary number of GLSA ids, " > print "filenames containing GLSAs or the special identifiers " > print "'all' and 'new'" > print >@@ -123,9 +129,9 @@ > > # list short information for given or new GLSA > if mode == "list": >- print "[A] means this GLSA was already applied," >- print "[U] means the system is not affected and" >- print "[N] indicates that the system might be affected." >+ print "[OK] means this GLSA was already applied," >+ print "[NA] means the system is not affected and" >+ print "[!!] indicates that the system might be affected." > print > for myid in glsalist: > try: >@@ -134,11 +140,11 @@ > #print "invalid GLSA: %s (error message was: %s)" % (myid, e) > continue > if myglsa.isApplied(): >- status = "[A]" >+ status = "[%s]" % (darkgreen("OK")) > elif myglsa.isVulnerable(): >- status = "[N]" >+ status = "[%s]" % (red("!!")) > else: >- status = "[U]" >+ status = "[%s]" % (green("NA")) > print myglsa.nr, status, myglsa.title, "(", > for pkg in myglsa.packages.keys()[:3]: > print pkg, >@@ -146,6 +152,23 @@ > print "...", > print ")" > sys.exit(0) >+# show only dangerous packages >+if mode == "show": >+ for myid in glsalist: >+ try: >+ myglsa = Glsa(myid, glsaconfig) >+ except GlsaTypeException, e: >+ #print "invalid GLSA: %s (error message was: %s)" % (myid, e) >+ continue >+ if ((not myglsa.isApplied()) and myglsa.isVulnerable()): >+ status = "[%s]" % (red("!!")) >+ print myglsa.nr, status, myglsa.title, "(", >+ for pkg in myglsa.packages.keys()[:3]: >+ print pkg, >+ if len(myglsa.packages) > 3: >+ print "...", >+ print ")" >+ sys.exit(0) > > # dump, fix, inject and fix are nearly the same code, only the glsa method call differs > if mode in ["dump", "fix", "inject", "pretend"]:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 47953
: 33317