sstate: add a function to get the sstate file name in sstate_checkhashes

(From OE-Core rev: dc64479264bdf3d60ece02a98b65be35650f8f86)

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jose Quaresma
2021-11-09 11:11:48 +00:00
committed by Richard Purdie
parent e7acdb37af
commit 91fab7aa7e

View File

@@ -934,12 +934,13 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
return spec, extrapath, tname
def getsstatefile(tid, siginfo, d):
spec, extrapath, tname = getpathcomponents(tid, d)
return extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d)
for tid in sq_data['hash']:
spec, extrapath, tname = getpathcomponents(tid, d)
sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d))
sstatefile = d.expand("${SSTATE_DIR}/" + getsstatefile(tid, siginfo, d))
if os.path.exists(sstatefile):
found.add(tid)
@@ -1000,8 +1001,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
tasklist = []
for tid in missed:
spec, extrapath, tname = getpathcomponents(tid, d)
sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d))
sstatefile = d.expand(getsstatefile(tid, siginfo, d))
tasklist.append((tid, sstatefile))
if tasklist:
@@ -1028,12 +1028,10 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
if "toaster" in inheritlist:
evdata = {'missed': [], 'found': []};
for tid in missed:
spec, extrapath, tname = getpathcomponents(tid, d)
sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, False, d))
sstatefile = d.expand(getsstatefile(tid, False, d))
evdata['missed'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
for tid in found:
spec, extrapath, tname = getpathcomponents(tid, d)
sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, False, d))
sstatefile = d.expand(getsstatefile(tid, False, d))
evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)