From d326382b5fdfc31a4f4a8e63f26fdd0d808a2270 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 22 Sep 2009 20:14:34 +0100 Subject: bitbake/build.py: Remove zero sized log files Signed-off-by: Richard Purdie --- bitbake-dev/lib/bb/build.py | 4 ++++ bitbake/lib/bb/build.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bitbake-dev/lib/bb/build.py b/bitbake-dev/lib/bb/build.py index 9bb5abd78d..05b7d94d13 100644 --- a/bitbake-dev/lib/bb/build.py +++ b/bitbake-dev/lib/bb/build.py @@ -184,6 +184,10 @@ def exec_func(func, d, dirs = None): so.close() se.close() + if os.path.getsize(logfile) == 0: + bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) + os.remove(logfile) + # Close the backup fds os.close(osi[0]) os.close(oso[0]) diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 7644bf0ee7..e56f4bcf16 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -225,6 +225,10 @@ def exec_func_shell(func, d, flags): so.close() se.close() + if os.path.getsize(logfile) == 0: + bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) + os.remove(logfile) + # close the backup fds os.close(osi[0]) os.close(oso[0]) -- cgit v1.2.3