Lines 25-32
Link Here
|
25 |
["-V", "--version", "some information about this tool"], |
25 |
["-V", "--version", "some information about this tool"], |
26 |
["-v", "--verbose", "print more information (option)"], |
26 |
["-v", "--verbose", "print more information (option)"], |
27 |
["-c", "--cve", "show CAN ids in listing mode (option)"], |
27 |
["-c", "--cve", "show CAN ids in listing mode (option)"], |
28 |
["-m", "--mail", "send a mail with the given GLSAs to the administrator"], |
28 |
["-m", "--mail", "send a mail with the given GLSAs to the administrator"] |
29 |
["-e", "--mail-if-necessary", "send a mail with the given GLSAs to the administrator, only if there's something to do"] |
|
|
30 |
] |
29 |
] |
31 |
|
30 |
|
32 |
# print a warning as this is beta code (but proven by now, so no more warning) |
31 |
# print a warning as this is beta code (but proven by now, so no more warning) |
Lines 43-49
Link Here
|
43 |
try: |
42 |
try: |
44 |
args, params = getopt(sys.argv[1:], "".join([o[0][1] for o in optionmap]), \ |
43 |
args, params = getopt(sys.argv[1:], "".join([o[0][1] for o in optionmap]), \ |
45 |
[x[2:] for x in reduce(lambda x,y: x+y, [z[1:-1] for z in optionmap])]) |
44 |
[x[2:] for x in reduce(lambda x,y: x+y, [z[1:-1] for z in optionmap])]) |
46 |
# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "mail", "mail-if-necessary"]) |
45 |
# ["dump", "print", "list", "pretend", "fix", "inject", "help", "verbose", "version", "test", "nocolor", "cve", "mail"]) |
47 |
args = [a for a,b in args] |
46 |
args = [a for a,b in args] |
48 |
|
47 |
|
49 |
for option in ["--nocolor", "-n"]: |
48 |
for option in ["--nocolor", "-n"]: |
Lines 83-89
Link Here
|
83 |
mode = "help" |
82 |
mode = "help" |
84 |
|
83 |
|
85 |
# we need a set of glsa for most operation modes |
84 |
# we need a set of glsa for most operation modes |
86 |
if len(params) <= 0 and mode in ["fix", "test", "pretend", "dump", "inject", "mail", "mail-if-necessary"]: |
85 |
if len(params) <= 0 and mode in ["fix", "test", "pretend", "dump", "inject", "mail"]: |
87 |
sys.stderr.write("\nno GLSA given, so we'll do nothing for now. \n") |
86 |
sys.stderr.write("\nno GLSA given, so we'll do nothing for now. \n") |
88 |
sys.stderr.write("If you want to run on all GLSA please tell me so \n") |
87 |
sys.stderr.write("If you want to run on all GLSA please tell me so \n") |
89 |
sys.stderr.write("(specify \"all\" as parameter)\n\n") |
88 |
sys.stderr.write("(specify \"all\" as parameter)\n\n") |
Lines 273-283
Link Here
|
273 |
sys.exit(0) |
272 |
sys.exit(0) |
274 |
|
273 |
|
275 |
# mail mode as requested by solar |
274 |
# mail mode as requested by solar |
276 |
if mode == "mail" or mode == "mail-if-necessary": |
275 |
if mode == "mail": |
277 |
|
|
|
278 |
if mode == "mail-if-necessary" and len(glsalist) == 0: |
279 |
sys.exit(0) |
280 |
|
281 |
import portage_mail, socket |
276 |
import portage_mail, socket |
282 |
from StringIO import StringIO |
277 |
from StringIO import StringIO |
283 |
|
278 |
|