[oe] [PATCH] build.py: Check for valid file before removing zero sized file.

Khem Raj raj.khem at gmail.com
Thu Oct 22 04:49:23 UTC 2009


* 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 <raj.khem at gmail.com>
---
 lib/bb/build.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 05b7d94..b7e93be 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -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)
 
-- 
1.6.3.3





More information about the Openembedded-devel mailing list