summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-03-02 20:17:08 +0000
committerZac Medico <zmedico@gentoo.org>2010-03-02 20:17:08 +0000
commit2e4455de659a26819c348903130f651dc6faf40c (patch)
tree0209bd9951050d5cdb6dbf784d9acdefef2aeb13 /pym
parent0ee401910b579d1c0a7ac4849fa0a8632baa1e68 (diff)
downloadportage-2e4455de659a26819c348903130f651dc6faf40c.tar.gz
portage-2e4455de659a26819c348903130f651dc6faf40c.tar.bz2
portage-2e4455de659a26819c348903130f651dc6faf40c.zip
Bug #304981 - Truncate the build log after successful fetch, instead of
removing it, so as not to interfere with tail -f. (trunk r15352) svn path=/main/branches/2.1.7/; revision=15579
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/EbuildBuildDir.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/_emerge/EbuildBuildDir.py b/pym/_emerge/EbuildBuildDir.py
index e501357e7..99c48dfb6 100644
--- a/pym/_emerge/EbuildBuildDir.py
+++ b/pym/_emerge/EbuildBuildDir.py
@@ -63,10 +63,11 @@ class EbuildBuildDir(SlotObject):
def clean_log(self):
"""Discard existing log."""
settings = self.settings
-
- for x in ('.logid', 'temp/build.log'):
+ log_file = settings.get('PORTAGE_LOG_FILE')
+ if log_file is not None and os.path.isfile(log_file):
+ # Truncate rather than unlink, so tail -f still works.
try:
- os.unlink(os.path.join(settings["PORTAGE_BUILDDIR"], x))
+ open(log_file, 'wb')
except OSError:
pass