summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-03 23:10:12 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-13 12:15:21 +0000
commit1fd3265374f2ecc85c7835989c01b69482e72020 (patch)
tree5ed3c06556bd8127b9e4dbc836c5eea72cfa06e1
parent58c01c147cdc04db30af9892cb67220123503337 (diff)
downloadpoky-1fd3265374f2ecc85c7835989c01b69482e72020.tar.gz
build.py: Fix zero size logfile problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--bitbake/lib/bb/build.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 447aa48058..1d6742b6e6 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -227,7 +227,7 @@ def exec_func_shell(func, d, flags):
227 so.close() 227 so.close()
228 se.close() 228 se.close()
229 229
230 if os.path.getsize(logfile) == 0: 230 if os.path.exists(logfile) and os.path.getsize(logfile) == 0:
231 bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) 231 bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile)
232 os.remove(logfile) 232 os.remove(logfile)
233 233
@@ -248,7 +248,7 @@ def exec_func_shell(func, d, flags):
248 number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d) 248 number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
249 if number_of_lines: 249 if number_of_lines:
250 os.system('tail -n%s %s' % (number_of_lines, logfile)) 250 os.system('tail -n%s %s' % (number_of_lines, logfile))
251 else: 251 elif os.path.exists(logfile):
252 f = open(logfile, "r") 252 f = open(logfile, "r")
253 while True: 253 while True:
254 l = f.readline() 254 l = f.readline()
@@ -257,6 +257,8 @@ def exec_func_shell(func, d, flags):
257 l = l.rstrip() 257 l = l.rstrip()
258 print '| %s' % l 258 print '| %s' % l
259 f.close() 259 f.close()
260 else:
261 bb.msg.error(bb.msg.domain.Build, "There was no logfile output")
260 else: 262 else:
261 bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile) 263 bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile)
262 raise FuncFailed( logfile ) 264 raise FuncFailed( logfile )