Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 190593 Details for
Bug 182990
[PATCH] Make glsa-check not sending mail when unaffected
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Add quiet option
0001-Add-quiet-option.patch (text/plain), 3.86 KB, created by
Robert Buchholz (RETIRED)
on 2009-05-07 01:45:18 UTC
(
hide
)
Description:
[PATCH] Add quiet option
Filename:
MIME Type:
Creator:
Robert Buchholz (RETIRED)
Created:
2009-05-07 01:45:18 UTC
Size:
3.86 KB
patch
obsolete
>From 663f1650345b44c8861eb4102b6657e38bfc1d12 Mon Sep 17 00:00:00 2001 >From: Robert Buchholz <rbu@goodpoint.de> >Date: Thu, 7 May 2009 03:09:46 +0200 >Subject: [PATCH] Add quiet option > >Incorporate option to quiet down glsa-check, based on a patch by Thilo >Bangert <bangert@gentoo.org> in bug #170784. >This option will also suppress sending of empty mail, based on a patch >by Christian Gut <cycloon@is-root.org> in bug #182990. >--- > glsa-check | 28 ++++++++++++++++++++-------- > glsa-check.1 | 5 ++++- > 2 files changed, 24 insertions(+), 9 deletions(-) > >diff --git a/glsa-check b/glsa-check >index 67ef7de..5150d2c 100755 >--- a/glsa-check >+++ b/glsa-check >@@ -36,7 +36,8 @@ optionmap = [ > ["-V", "--version", "some information about this tool"], > ["-v", "--verbose", "print more information (option)"], > ["-c", "--cve", "show CVE ids in listing mode (option)"], >-["-m", "--mail", "send a mail with the given GLSAs to the administrator"] >+["-q", "--quiet", "be less verbose and do not send empty mail (option)"], >+["-m", "--mail", "send a mail with the given GLSAs to the administrator"], > ] > > # print a warning as this is beta code (but proven by now, so no more warning) >@@ -53,7 +54,6 @@ params = [] > try: > args, params = getopt(sys.argv[1:], "".join([o[0][1] for o in optionmap]), \ > [x[2:] for x in reduce(lambda x,y: x+y, [z[1:-1] for z in optionmap])]) >-# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "mail"]) > args = [a for a,b in args] > > for option in ["--nocolor", "-n"]: >@@ -79,6 +79,13 @@ try: > least_change = False > args.remove(option) > >+ quiet = False >+ for option in ["--quiet", "-q"]: >+ if option in args: >+ quiet = True >+ args.remove(option) >+ >+ > # sanity checking > if len(args) <= 0: > sys.stderr.write("no option given: what should I do ?\n") >@@ -141,6 +148,9 @@ from glsa import * > > glsaconfig = checkconfig(portage.config(clone=portage.settings)) > >+if quiet: >+ glsaconfig["EMERGE_OPTS"] += " --quiet" >+ > vardb = portage.db["/"]["vartree"].dbapi > portdb = portage.db["/"]["porttree"].dbapi > >@@ -188,9 +198,10 @@ for p in params[:]: > glsalist.extend([g for g in params if g not in glsalist]) > > def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr): >- fd2.write(white("[A]")+" means this GLSA was already applied,\n") >- fd2.write(green("[U]")+" means the system is not affected and\n") >- fd2.write(red("[N]")+" indicates that the system might be affected.\n\n") >+ if not quiet: >+ fd2.write(white("[A]")+" means this GLSA was already applied,\n") >+ fd2.write(green("[U]")+" means the system is not affected and\n") >+ fd2.write(red("[N]")+" indicates that the system might be affected.\n\n") > > myglsalist.sort() > for myid in myglsalist: >@@ -361,9 +372,10 @@ if mode == "mail": > myglsa.dump(outstream=myfd) > myattachments.append(MIMEText(str(myfd.getvalue()), _charset="utf8")) > myfd.close() >- >- mymessage = portage_mail.create_message(myfrom, myrecipient, mysubject, summary, myattachments) >- portage_mail.send_mail(glsaconfig, mymessage) >+ >+ if glsalist or not quiet: >+ mymessage = portage_mail.create_message(myfrom, myrecipient, mysubject, summary, myattachments) >+ portage_mail.send_mail(glsaconfig, mymessage) > > sys.exit(0) > >diff --git a/glsa-check.1 b/glsa-check.1 >index 0838976..9ec37c7 100644 >--- a/glsa-check.1 >+++ b/glsa-check.1 >@@ -1,7 +1,7 @@ > .TH "glsa-check" "1" "0.6" "Marius Mauch" "gentoolkit" > .SH "NAME" > .LP >-glsa\-check \- Gentoo: Tool to locally monitor and manage GLSA's >+glsa\-check \- Gentoo: Tool to locally monitor and manage GLSAs > .SH "SYNTAX" > .LP > glsa\-check <\fIoption\fP> [\fIglsa\-list\fP] >@@ -52,6 +52,9 @@ print more messages (option) > .TP > .B \-c, \-\-cve > show CVE ids in listing mode (option) >+.TP >+.B \-q, \-\-quiet >+be less verbose and do not send empty mail (option) > .TP > .B \-m, \-\-mail > send a mail with the given GLSAs to the administrator >-- >1.6.2.3 >
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 182990
:
122900
|
171302
| 190593