From c089d3fb840fcb9a552f276e948381c45653db90 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 14 Feb 2010 00:56:43 +0000 Subject: Bug #304981 - Truncate the build log after successful fetch, instead of removing it, so as not to interfere with tail -f. svn path=/main/trunk/; revision=15352 --- pym/_emerge/EbuildBuildDir.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pym/_emerge') 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 -- cgit v1.2.3-1-g7c22