Remove fetch log after successful fetch. (trunk r15721)
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 22:29:08 +0000 (22:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 22:29:08 +0000 (22:29 -0000)
svn path=/main/branches/2.1.7/; revision=15724

pym/_emerge/Binpkg.py

index a8d07630ba8341440685fe2a6506e68ea9537022..4f2a073444d20d0614e5db6fac41475dc7c5a13c 100644 (file)
@@ -171,6 +171,14 @@ class Binpkg(CompositeTask):
                if self._fetched_pkg:
                        self._bintree.inject(pkg.cpv, filename=pkg_path)
 
+               logfile = self.settings.get("PORTAGE_LOG_FILE")
+               if logfile is not None and os.path.isfile(logfile):
+                       # Remove fetch log after successful fetch.
+                       try:
+                               os.unlink(logfile)
+                       except OSError:
+                               pass
+
                if self.opts.fetchonly:
                        self._current_task = None
                        self.returncode = os.EX_OK