build.py: Check for valid file before removing zero sized file.
PATCH 1/1 build.py: Check for valid file before removing zero sized file.
* getsize returns an error if the file does not exist we check first if the file exist and then we check if it is zero sized. So we can avoid the error when doing bitbake -c clean -b <recipe>
Signed-off-by Khem Raj <[email protected]>
--- lib/bb/build.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/build.py +1 -1
@@ -184,7 +184,7 @@ def exec_func(func, d, dirs = None): so.close() se.close() - if os.path.getsize(logfile) == 0: + if os.path.isfile(logfile) is True and os.path.getsize(logfile) == 0: bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) os.remove(logfile)
Signature · 1 line
1.6.3.3