#
import os, sys, ConfigParser, getopt
-version="1.1"
+version="1.2"
if __name__ == '__main__':
name = email = project = password = url = None
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:
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)
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)
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.</para>
+submitting a tarball and analysis request to the server, and (d)
+retrieving the request status.</para>
</refsect1>
<refsect1><title>CONFIGURATION</title>
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
'tools' option to tell <application>coverity-submit</application>
where to find it.</para>
-<para>The 'upload' and 'advertise' option are required. They tell
-<application>coverity-submit</application> 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.</para>
-
<para>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.</para>
+<para>The <option>build</option> and <option>advertise</option>
+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.</para>
</refsect1>
<refsect1><title>OPERATION</title>
<step><para>The project's local build command.</para></step>
<step><para>The project's local postbuild command, if specified.</para></step>
<step><para>Generating a README and bundling it into a tarball with the scan results.</para></step>
-<step><para>Copying the tarball to the upload location.</para></step>
-<step><para>Sending an analysis job request to the Coverity server.</para></step>
+<step><para>Sending the tarball and an analysis job request to the Coverity server.</para></step>
</procedure>
<para>The script will report the result of the job request by dumping the