[1/2] sstate.bbclass: update missed sstate event

Submitted by Alexandru DAMIAN on March 31, 2014, 4:39 p.m.

Details

Message ID 7445f7145ee425302da5b9d1ca77e3448899b78d.1396283886.git.alexandru.damian@intel.com
State Accepted
Commit ad66cd521d3e661dd57c5aa02c204585101984f3
Headers show

Commit Message

Alexandru DAMIAN March 31, 2014, 4:39 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

This is a patch to update the missed sstate event with
info about the sstate files locations that were found.
It's needed as to display the found file in the toaster ui.

Also fixes a bug where a setscene task may have appeared in the
missed list even if it was found in a sstate mirror.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 meta/classes/sstate.bbclass | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 25b8d72..f761909 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -690,6 +690,8 @@  def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
                 fetcher.checkstatus()
                 bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
                 ret.append(task)
+                if task in missed:
+                    missed.remove(task)
             except:
                 missed.append(task)
                 bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
@@ -697,9 +699,15 @@  def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
 
     inheritlist = d.getVar("INHERIT", True)
     if "toaster" in inheritlist:
-        evdata = []
+        evdata = {'missed': [], 'found': []};
         for task in missed:
-            evdata.append( (sq_fn[task], sq_task[task], sq_hash[task], generate_sstatefn(spec, sq_hash[task],d) ) )
+            spec, extrapath, tname = getpathcomponents(task, d)
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz")
+            evdata['missed'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
+        for task in ret:
+            spec, extrapath, tname = getpathcomponents(task, d)
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz")
+            evdata['found'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
         bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
 
     return ret