From: Holger Freyther Date: Thu, 17 Aug 2006 14:40:54 +0000 (+0000) Subject: classes/tinderclient.bbclass: Fixes. truncate does not work this way... X-Git-Tag: Release-2010-05/1~9453^2~935^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be18b92133b1326202241c23613baaa34ccd2c7a;p=openembedded.git 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 --- 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