summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/build.py
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 /bitbake/lib/bb/build.py
parent58c01c147cdc04db30af9892cb67220123503337 (diff)
downloadopenembedded-core-1fd3265374f2ecc85c7835989c01b69482e72020.tar.gz
openembedded-core-1fd3265374f2ecc85c7835989c01b69482e72020.tar.bz2
openembedded-core-1fd3265374f2ecc85c7835989c01b69482e72020.tar.xz
openembedded-core-1fd3265374f2ecc85c7835989c01b69482e72020.zip
build.py: Fix zero size logfile problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-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 447aa4805..1d6742b6e 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -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 )