From be18b92133b1326202241c23613baaa34ccd2c7a Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Thu, 17 Aug 2006 14:40:54 +0000 Subject: classes/tinderclient.bbclass: Fixes. truncate does not work this way... Fixup truncate to forget the the status of previous runs. We will simply write("") to the file and empty it this way. int(f.read()) will fail then --- classes/tinderclient.bbclass | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'classes/tinderclient.bbclass') diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass index 58b4e540d0..0cfa9c7ea0 100644 --- a/classes/tinderclient.bbclass +++ b/classes/tinderclient.bbclass @@ -279,14 +279,17 @@ 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", 'rw+') - g.truncate(0) + g = file(data.getVar('TMPDIR', event.data, True)+"/tinder-status", 'w') + g.write("") g.close() except IOError: pass @@ -325,7 +328,6 @@ def tinder_do_tinder_report(event): try: h = file(data.getVar('TMPDIR',event.data,True)+'/tinder-status', 'r') status = int(h.read()) - print "New status %d" % status except: pass -- cgit 1.2.3-korg