--- /usr/local/bin/glsa-check 2008-01-13 13:35:57.000000000 -0800 +++ /usr/bin/glsa-check 2008-01-12 05:49:25.000000000 -0800 @@ -25,8 +25,7 @@ ["-V", "--version", "some information about this tool"], ["-v", "--verbose", "print more information (option)"], ["-c", "--cve", "show CAN ids in listing mode (option)"], -["-m", "--mail", "send a mail with the given GLSAs to the administrator"], -["-e", "--mail-if-necessary", "send a mail with the given GLSAs to the administrator, only if there's something to do"] +["-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) @@ -43,7 +42,7 @@ 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", "mail-if-necessary"]) +# ["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"]: @@ -83,7 +82,7 @@ mode = "help" # we need a set of glsa for most operation modes -if len(params) <= 0 and mode in ["fix", "test", "pretend", "dump", "inject", "mail", "mail-if-necessary"]: +if len(params) <= 0 and mode in ["fix", "test", "pretend", "dump", "inject", "mail"]: sys.stderr.write("\nno GLSA given, so we'll do nothing for now. \n") sys.stderr.write("If you want to run on all GLSA please tell me so \n") sys.stderr.write("(specify \"all\" as parameter)\n\n") @@ -273,11 +272,7 @@ sys.exit(0) # mail mode as requested by solar -if mode == "mail" or mode == "mail-if-necessary": - - if mode == "mail-if-necessary" and len(glsalist) == 0: - sys.exit(0) - +if mode == "mail": import portage_mail, socket from StringIO import StringIO