Discard the log on success, since otherwise we'll have multiple log files for
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Oct 2009 19:19:23 +0000 (19:19 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Oct 2009 19:19:23 +0000 (19:19 -0000)
the same package.

svn path=/main/trunk/; revision=14559

pym/_emerge/BinpkgVerifier.py

index 404becf090b70917c880cd0dd89f71731cc4c310..d369587177ab91d44a53edef1d80720141704f44 100644 (file)
@@ -54,7 +54,15 @@ class BinpkgVerifier(AsynchronousTask):
                                writemsg("!!! Expected: %s\n" % e.value[3],
                                        noiselevel=-1)
                                rval = 1
-                       if rval != os.EX_OK:
+                       if rval == os.EX_OK:
+                               # If this was successful, discard the log here since otherwise
+                               # we'll get multiple logs for the same package.
+                               if log_file is not None:
+                                       try:
+                                               os.unlink(self.logfile)
+                                       except OSError:
+                                               pass
+                       else:
                                pkg_path = bintree.getname(pkg.cpv)
                                head, tail = os.path.split(pkg_path)
                                temp_filename = portage._checksum_failure_temp_file(head, tail)