diff options
| -rw-r--r-- | bitbake/lib/bb/build.py | 6 |
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 ) |
