diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-03-17 15:04:09 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-21 12:05:53 +0000 |
commit | da4c46fc78abcd386ea523c3f9c8d35d445c25e3 (patch) | |
tree | 1a9a83fd3c72beb343fb7bb4207486c1d2c2b627 | |
parent | 4ce36a45e2cbd1571118fc6826190eaef01468ad (diff) | |
download | poky-da4c46fc78abcd386ea523c3f9c8d35d445c25e3.tar.gz |
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>
-rw-r--r-- | meta/classes/sstate.bbclass | 11 |
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" | |||
625 | def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): | 625 | def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): |
626 | 626 | ||
627 | ret = [] | 627 | ret = [] |
628 | missed = [] | ||
628 | 629 | ||
629 | def getpathcomponents(task, d): | 630 | def getpathcomponents(task, d): |
630 | # Magic data from BB_HASHFILENAME | 631 | # Magic data from BB_HASHFILENAME |
@@ -646,11 +647,13 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): | |||
646 | spec, extrapath, tname = getpathcomponents(task, d) | 647 | spec, extrapath, tname = getpathcomponents(task, d) |
647 | 648 | ||
648 | sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz.siginfo") | 649 | sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz.siginfo") |
650 | |||
649 | if os.path.exists(sstatefile): | 651 | if os.path.exists(sstatefile): |
650 | bb.debug(2, "SState: Found valid sstate file %s" % sstatefile) | 652 | bb.debug(2, "SState: Found valid sstate file %s" % sstatefile) |
651 | ret.append(task) | 653 | ret.append(task) |
652 | continue | 654 | continue |
653 | else: | 655 | else: |
656 | missed.append(task) | ||
654 | bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile) | 657 | bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile) |
655 | 658 | ||
656 | mirrors = d.getVar("SSTATE_MIRRORS", True) | 659 | mirrors = d.getVar("SSTATE_MIRRORS", True) |
@@ -688,9 +691,17 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): | |||
688 | bb.debug(2, "SState: Successful fetch test for %s" % srcuri) | 691 | bb.debug(2, "SState: Successful fetch test for %s" % srcuri) |
689 | ret.append(task) | 692 | ret.append(task) |
690 | except: | 693 | except: |
694 | missed.append(task) | ||
691 | bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri) | 695 | bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri) |
692 | pass | 696 | pass |
693 | 697 | ||
698 | inheritlist = d.getVar("INHERIT", True) | ||
699 | if "toaster" in inheritlist: | ||
700 | evdata = [] | ||
701 | for task in missed: | ||
702 | evdata.append( (sq_fn[task], sq_task[task], sq_hash[task], generate_sstatefn(spec, sq_hash[task],d) ) ) | ||
703 | bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d) | ||
704 | |||
694 | return ret | 705 | return ret |
695 | 706 | ||
696 | BB_SETSCENE_DEPVALID = "setscene_depvalid" | 707 | BB_SETSCENE_DEPVALID = "setscene_depvalid" |