From 93a8d0662ed361c76defe75a5cd84f203fdb1af1 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sun, 27 Aug 2006 16:01:33 +0000 Subject: classes: Sync with OE git-svn-id: https://svn.o-hand.com/repos/poky/trunk@651 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- meta/classes/tinderclient.bbclass | 48 +++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) (limited to 'meta/classes/tinderclient.bbclass') diff --git a/meta/classes/tinderclient.bbclass b/meta/classes/tinderclient.bbclass index f544c203fe..d36ef0b343 100644 --- a/meta/classes/tinderclient.bbclass +++ b/meta/classes/tinderclient.bbclass @@ -240,8 +240,8 @@ def tinder_tinder_start(d, event): output.append( "---> TINDERBOX BUILDING '%(packages)s'" ) output.append( "<--- TINDERBOX STARTING BUILD NOW" ) - output.append( "" ) - + output.append( "" ) + return "\n".join(output) % vars() def tinder_do_tinder_report(event): @@ -255,6 +255,14 @@ def tinder_do_tinder_report(event): information immediately. The caching/queuing needs to be implemented. Also sending more or less information is not implemented yet. + + We have two temporary files stored in the TMP directory. One file + contains the assigned machine id for the tinderclient. This id gets + assigned when we connect the box and start the build process the second + file is used to workaround an EventHandler limitation. If BitBake is ran + with the continue option we want the Build to fail even if we get the + BuildCompleted Event. In this case we have to look up the status and + send it instead of 100/success. """ from bb.event import getName from bb import data, mkdirhier, build @@ -264,7 +272,6 @@ def tinder_do_tinder_report(event): name = getName(event) log = "" status = 1 - #print asd # Check what we need to do Build* shows we start or are done if name == "BuildStarted": tinder_build_start(event.data) @@ -272,9 +279,18 @@ def tinder_do_tinder_report(event): try: # truncate the tinder log file - f = file(data.getVar('TINDER_LOG', event.data, True), 'rw+') - f.truncate(0) + f = file(data.getVar('TINDER_LOG', event.data, True), 'w') + f.write("") f.close() + except: + pass + + try: + # write a status to the file. This is needed for the -k option + # of BitBake + g = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w') + g.write("") + g.close() except IOError: pass @@ -295,16 +311,27 @@ def tinder_do_tinder_report(event): elif name == "TaskFailed": log += "<--- TINDERBOX Task %s failed (FAILURE)\n" % event.task elif name == "PkgStarted": - log += "---> TINDERBOX Package %s started\n" % data.getVar('P', event.data, True) + log += "---> TINDERBOX Package %s started\n" % data.getVar('PF', event.data, True) elif name == "PkgSucceeded": - log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % data.getVar('P', event.data, True) + log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % data.getVar('PF', event.data, True) elif name == "PkgFailed": - build.exec_task('do_clean', event.data) - log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % data.getVar('P', event.data, True) + if not data.getVar('TINDER_AUTOBUILD', event.data, True) == "0": + build.exec_task('do_clean', event.data) + log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % data.getVar('PF', event.data, True) status = 200 + # remember the failure for the -k case + h = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w') + h.write("200") elif name == "BuildCompleted": log += "Build Completed\n" status = 100 + # Check if we have a old status... + try: + h = file(data.getVar('TMPDIR',event.data,True)+'/tinder-status', 'r') + status = int(h.read()) + except: + pass + elif name == "MultipleProviders": log += "---> TINDERBOX Multiple Providers\n" log += "multiple providers are available (%s);\n" % ", ".join(event.getCandidates()) @@ -315,6 +342,9 @@ def tinder_do_tinder_report(event): log += "Error: No Provider for: %s\n" % event.getItem() log += "Error:Was Runtime: %d\n" % event.isRuntime() status = 200 + # remember the failure for the -k case + h = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w') + h.write("200") # now post the log if len(log) == 0: -- cgit v1.2.3-54-g00ecf