]> thyrsus.com Git - coverity-submit.git/commitdiff
Now functionally equivalent to the shell version.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 12 May 2012 17:54:24 +0000 (13:54 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 12 May 2012 17:54:24 +0000 (13:54 -0400)
coverity-submit

index 82100a2df895c75cc52ddf6af52a0100b0cfd247..0a6997ff22d8abc419d2c833d766ae0803ed3e1c 100755 (executable)
@@ -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: