Skip to contentSkip to conversation

build.py: Check for valid file before removing zero sized file.

PATCH New Khem Raj 1 participant 1 message Oct 22, 2009

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

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>

---
 lib/bb/build.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/build.py +1 -1
index 05b7d94..b7e93be 100644
@@ -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