sstate: list missing files for toaster

Toaster needs to record the attempts to restore
setscene tasks that don't have a sstate file.

We build a list of tasks for which we can't find an
sstate file, and if we're running under Toaster data
collection, we send it off with a MetadataEvent.

(From OE-Core rev: 109ae6c5c981610ab0d63d2c83dcd50b2e93276b)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN 2014-03-17 15:04:09 +00:00 committed by Richard Purdie
parent 4ce36a45e2
commit da4c46fc78
1 changed files with 11 additions and 0 deletions

View File

@ -625,6 +625,7 @@ BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
ret = []
missed = []
def getpathcomponents(task, d):
# Magic data from BB_HASHFILENAME
@ -646,11 +647,13 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
spec, extrapath, tname = getpathcomponents(task, d)
sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz.siginfo")
if os.path.exists(sstatefile):
bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
ret.append(task)
continue
else:
missed.append(task)
bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile)
mirrors = d.getVar("SSTATE_MIRRORS", True)
@ -688,9 +691,17 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
ret.append(task)
except:
missed.append(task)
bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
pass
inheritlist = d.getVar("INHERIT", True)
if "toaster" in inheritlist:
evdata = []
for task in missed:
evdata.append( (sq_fn[task], sq_task[task], sq_hash[task], generate_sstatefn(spec, sq_hash[task],d) ) )
bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
return ret
BB_SETSCENE_DEPVALID = "setscene_depvalid"