]> code.ossystems Code Review - openembedded-core.git/commitdiff
build.py: Fix zero size logfile problems
authorRichard Purdie <rpurdie@linux.intel.com>
Tue, 3 Nov 2009 23:10:12 +0000 (23:10 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 13 Nov 2009 12:15:21 +0000 (12:15 +0000)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/build.py

index 447aa4805847c4559117c07a8cd19b2e619bf4ec..1d6742b6e6f0fd5dcd882a9663fc393dabb8c76e 100644 (file)
@@ -227,7 +227,7 @@ def exec_func_shell(func, d, flags):
         so.close()
         se.close()
 
-        if os.path.getsize(logfile) == 0:
+        if os.path.exists(logfile) and os.path.getsize(logfile) == 0:
             bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile)
             os.remove(logfile)
 
@@ -248,7 +248,7 @@ def exec_func_shell(func, d, flags):
             number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
             if number_of_lines:
                 os.system('tail -n%s %s' % (number_of_lines, logfile))
-            else:
+            elif os.path.exists(logfile):
                 f = open(logfile, "r")
                 while True:
                     l = f.readline()
@@ -257,6 +257,8 @@ def exec_func_shell(func, d, flags):
                     l = l.rstrip()
                     print '| %s' % l
                 f.close()
+            else:
+                bb.msg.error(bb.msg.domain.Build, "There was no logfile output")
         else:
             bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile)
         raise FuncFailed( logfile )