]> thyrsus.com Git - coverity-submit.git/commitdiff
Make it safe for multiple users.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 13 Jan 2013 00:02:33 +0000 (19:02 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 13 Jan 2013 00:02:33 +0000 (19:02 -0500)
NEWS
coverity-submit

diff --git a/NEWS b/NEWS
index fdddf96365e287de75356e5daa45d4cd0aa54a0f..ad5dfe586deefb944e2f69d0bfa8299df83ed96c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
                        NEWS file for coverty-submit
 
+1.4 @
+    Make it safe for multiple users on the same machine.
+    Implement a verbosityu option.
+
 1.3 @ 2012-11-22
     Minor documentation updates.
 
index bdb3e9f20420aa9fcd20f9733523c0858154c056..4ab821a178cac18d6079364adf0950dbe987abdc 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # By Eric S. Raymond, May 2012.  BSD terms apply.
 #
-import os, sys, ConfigParser, getopt
+import os, sys, ConfigParser, getopt, tempfile
 
 version = "1.3"
 
@@ -106,20 +106,25 @@ if __name__ == '__main__':
     """ % globals()
     if verbose:
         sys.stdout.write(readme)
+    tmpdir = tempfile.mkdtemp()
     if not noexec:
-        with open("/tmp/README", "w") as wfp:
+        with open(os.path.join(tmpdir, "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)
+    do_or_die("mv cov-int %s; (cd %s; tar -czf %s README cov-int; rm -fr README cov-int)" % (tmpdir, tmpdir, tarball))
     print("Posting the analysis request...")
     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())
-
+     http://scan5.coverity.com/cgi-bin/upload.py \
+     ''' % globals())
+    try:
+        os.remove(os.path.join(tmpdir, tarball))
+        os.rmdir(tmpdir)
+    except OSError:
+        pass
     print("Done. You'll get mail at %s." % email)
 
 # The following sets edit modes for GNU EMACS