From c3dfe39e118113d6427c766e93f3baa82cc884dc Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 5 Sep 2012 09:47:34 -0400 Subject: [PATCH] Update for Coverity's simplified submission procedure. --- NEWS | 3 +++ coverity-submit | 31 +++++++------------------------ coverity-submit.xml | 23 +++++++---------------- 3 files changed, 17 insertions(+), 40 deletions(-) diff --git a/NEWS b/NEWS index ac0312d..fc9c52c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ NEWS file for coverty-submit +1.2 @ 2012-09-05 + Changed to support Coverity's new direct-upload feature. + 1.0 @ 2012-05-14 Initial release. diff --git a/coverity-submit b/coverity-submit index 7871add..a00372b 100755 --- a/coverity-submit +++ b/coverity-submit @@ -6,7 +6,7 @@ # import os, sys, ConfigParser, getopt -version="1.1" +version="1.2" if __name__ == '__main__': name = email = project = password = url = None @@ -56,18 +56,6 @@ if __name__ == '__main__': email = config.get("ALL", "email") else: die("Every project requires an email option.") - if config.has_option(project, "upload"): - upload = config.get(project, "upload") - elif config.has_option("ALL", "upload"): - upload = config.get("ALL", "upload") - else: - die("Every project requires an upload option.") - if config.has_option(project, "advertise"): - advertise = config.get(project, "advertise") - elif config.has_option("ALL", "advertise"): - advertise = config.get("ALL", "advertise") - else: - die("Every project requires an advertise option.") if config.has_option(project, "prebuild"): prebuild = config.get(project, "prebuild") else: @@ -80,10 +68,6 @@ if __name__ == '__main__': postbuild = config.get(project, "postbuild") else: postbuild = None - if "%s" not in upload: - die("The upload option must contain a %s to plug a tarball name into.") - if "%s" not in advertise: - die("The advertise option must contain a %s to plug a tarball name into.") def do_or_die(cmd): print(cmd) @@ -122,14 +106,13 @@ if __name__ == '__main__': 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("Posting the analysis request...") - do_or_die('''curl --data \ - "project=%(project)s&password=%(password)s&email=%(email)s&url=%(url)s" \ - http://scan5.coverity.com/cgi-bin/submit_build.py + do_or_die('''curl \ + --form file=@/tmp/%(tarball)s \ + --form project=%(project)s \ + --form password=%(password)s \ + --form email=%(email)s \ + http://scan5.coverity.com/cgi-bin/upload.py ''' % globals()) print("Done. You'll get mail at %s." % email) diff --git a/coverity-submit.xml b/coverity-submit.xml index 29c24f6..f1ebfde 100644 --- a/coverity-submit.xml +++ b/coverity-submit.xml @@ -30,9 +30,8 @@ the demonstration Coverity server into a one-step operation. It automates the sequence of (a) running cov-build locally, (b) bundling the results into a tarball with a properly formatted README, (c) -uploading the result to a public drop area of your choice, and (d) -submitting an analysis request to the server, and (e) retrieving the -request status. +submitting a tarball and analysis request to the server, and (d) +retrieving the request status. CONFIGURATION @@ -47,8 +46,6 @@ name: Eric S. Raymond userid: esr email: esr@thyrsus.com tools: /usr/local/coverity/bin -upload: scp %s esr@login.ibiblio.org:/public/html/catb/esr -advertise: http://catb.org/~esr/%s [gpsd] password: XXXXXX @@ -72,21 +69,16 @@ or specify different addresses per-project. 'tools' option to tell coverity-submit where to find it. -The 'upload' and 'advertise' option are required. They tell -coverity-submit how to ship your tarball to -a public drop area where the Coverity server can see it, and the URL -the Coverity server can use to fetch it. Each of these options must -contain the string '%s' indicating where the generated name of the -tarball should be spliced in. Note that, like 'email', there can also -be specified in a per-project entry in case you want to have separate -per-project drop areas. - This configuration describes two different (real) projects, one with an scons-based build and one with an autotools-based build. For each project you must specifty the Coverity build password and the local build command to pass to cov-build. You may optionally specify local prebuild and postbuild commands. +The and +options of versions 1.1 annd previously are no longer needed, as +Coverity has changed its submission form to support direct upload of +the results tarball. OPERATION @@ -108,8 +100,7 @@ which project profile to use, it then performs the following steps: The project's local build command. The project's local postbuild command, if specified. Generating a README and bundling it into a tarball with the scan results. -Copying the tarball to the upload location. -Sending an analysis job request to the Coverity server. +Sending the tarball and an analysis job request to the Coverity server. The script will report the result of the job request by dumping the -- 2.43.0