# Deduce what project and directory to operate on (and go there).
noexec = False
- (opts, args) = getopt.getopt(sys.argv[1:], "n")
+ verbose = False
+ (opts, args) = getopt.getopt(sys.argv[1:], "nv")
for (opt, arg) in opts:
if opt == '-n':
noexec = True
+ if opt == '-v':
+ verbose = True
where = os.path.basename(os.getcwd())
if args:
project = args[0]
postbuild = None
def do_or_die(cmd):
- print(cmd)
+ if verbose:
+ print(cmd)
if not noexec:
if os.system(cmd) != 0:
sys.stderr.write("Command failed.\n")
do_or_die(postbuild)
# Create the tarball
- print("Bundling up required metadata...")
+ if verbose:
+ print("Bundling up required metadata...")
readme = """\
Name: %(name)s
Email: %(email)s
Project: %(project)s
Submitted-by: coverity-submit
""" % globals()
- sys.stdout.write(readme)
+ if verbose:
+ 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("Posting the analysis request...")
do_or_die('''curl \
--form file=@/tmp/%(tarball)s \
<cmdsynopsis>
<command>coverity-submit</command>
<arg choice='opt'>-n </arg>
+ <arg choice='opt'>-v </arg>
<arg choice='opt'><replaceable>project-name</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
name (it is a fatal error for it not to match one of the configured
project profiles).</para>
-<para>There is just one option; <option>-n</option>, which says to display
-all the commands that would be run without actually executing them.</para>
+<para>The <option>-n</option> option says to display all the commands that
+would be run without actually executing them. The <option>-v</option> option
+enables slightly more verbose progress messages.</para>
<para>Once <application>coverity-submit</application> has determined
which project profile to use, it then performs the following steps:</para>