summaryrefslogtreecommitdiff
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-03-17 15:04:09 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-21 12:05:31 +0000
commit109ae6c5c981610ab0d63d2c83dcd50b2e93276b (patch)
tree0c2769fd9b02a02fa80c61396ca0cbbf42141d7f /meta/classes/sstate.bbclass
parentff52c5ba15433f2b1e9723bf845e39da918ad59b (diff)
downloadopenembedded-core-109ae6c5c981610ab0d63d2c83dcd50b2e93276b.tar.gz
openembedded-core-109ae6c5c981610ab0d63d2c83dcd50b2e93276b.tar.bz2
openembedded-core-109ae6c5c981610ab0d63d2c83dcd50b2e93276b.zip
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. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 03ee820663..25b8d72633 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -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"