From 904f2b1011f1f3a556388a2e7c9281c0dd341a17 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 12 May 2012 13:54:24 -0400 Subject: [PATCH] Now functionally equivalent to the shell version. --- coverity-submit | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/coverity-submit b/coverity-submit index 82100a2..0a6997f 100755 --- a/coverity-submit +++ b/coverity-submit @@ -45,6 +45,10 @@ if config.has_option(project, "password"): password = config.get(project, "password") else: die("Every project requires a password option.") +if config.has_option(project, "email"): + email = config.get(project, "email") +else: + die("Every project requires an email option.") if config.has_option(project, "upload"): upload = config.get(project, "upload") else: @@ -74,9 +78,10 @@ def do_or_die(cmd): print(cmd) if not noexec: if os.system(cmd) != 0: - bailout("Command failed") + sys.stderr.write("Command failed.\n") # Build local stuff +print("Rebuilding and scanning...") if prebuild: do_or_die(prebuild) do_or_die("rm -fr cov-int && cov-build --dir cov-int " + build) @@ -84,6 +89,25 @@ if postbuild: do_or_die(postbuild) # Create the tarball +print("Bundling up required metadata...") +readme = """\ +Name: %(name)s +Email: %(email)s +Project: %(project)s +Submitted-by: coverity-submit +""" % locals() +sys.stdout.write(readme) +if not noexec: + with open("/tmp/README", "w") as wfp: + wfp.write(readme) +tarball = "%s-scan.tgz" % project +do_or_die("mv cov-int /tmp; (cd /tmp; tar -czf %s README cov-int; rm -fr cov-int)" % tarball) + +print("Uploading to where it's publicly visible...") +do_or_die(upload % ("/tmp/" + tarball)) +url = (advertise % tarball) + +print("Post %s to http://scan.coverity.com/submit.html" % url) # The following sets edit modes for GNU EMACS # Local Variables: -- 2.43.0