aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2007-08-18 23:44:44 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2007-08-18 23:44:44 +0000
commit697c4df9942242ac093ecde2e1fc4823269f06ff (patch)
tree6bb68ddc850c8162b49dc2c77a247bb15dd5ab71
parentabc17c2cad754eed635dbbe2f207e044e95fdf2a (diff)
downloadbitbake-697c4df9942242ac093ecde2e1fc4823269f06ff.tar.gz
knotty.py: Implement INCLUDELOGS handling
-rw-r--r--lib/bb/ui/knotty.py40
1 files changed, 21 insertions, 19 deletions
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 89a86d801..d322b1a19 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -31,6 +31,10 @@ parsespin = itertools.cycle( r'|/-\\' )
def init(frontend, eventHandler):
+ # Get values of variables which control our output
+ includelogs = frontend.runCommand(["readVariable", "BBINCLUDELOGS"])
+ loglines = frontend.runCommand(["readVariable", "BBINCLUDELOGS_LINES"])
+
try:
cmdline = frontend.runCommand(["getCmdLineAction"])
#print cmdline
@@ -38,10 +42,11 @@ def init(frontend, eventHandler):
return
ret = frontend.runCommand(cmdline)
if ret != True:
- print "Cook failed: %s" % ret
-
+ print "Couldn't get default commandlind! %s" % ret
+ return
except xmlrpclib.Fault, x:
- print x
+ print "XMLRPC Fault getting commandline:\n %s" % x
+ return
shutdown = 0
while True:
@@ -71,23 +76,20 @@ def init(frontend, eventHandler):
if event[0].startswith('bb.build.TaskFailed'):
logfile = event[1]['logfile']
if logfile:
-# if bb.data.getVar("BBINCLUDELOGS", d):
- print "ERROR: Logged data stored in %s" % logfile
+ print "ERROR: Logfile of failure stored in %s." % logfile
+ if includelogs:
print "Log data follows:\n"
-# number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
-# if number_of_lines:
-# os.system('tail -n%s %s' % (number_of_lines, logfile))
-# else:
- f = open(logfile, "r")
- while True:
- l = f.readline()
- if l == '':
- break
- l = l.rstrip()
- print '| %s' % l
- f.close()
-# else:
-# bb.msg.error(bb.msg.domain.Build, "see log in %s" % logfile)
+ if loglines:
+ os.system('tail -n%s %s' % (loglines, logfile))
+ else:
+ f = open(logfile, "r")
+ while True:
+ l = f.readline()
+ if l == '':
+ break
+ l = l.rstrip()
+ print '| %s' % l
+ f.close()
if event[0].startswith('bb.build.Task'):
print "NOTE: %s" % event[1]['_message']
continue