1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

sstate: Add ability to hide summary output for sstate

Its confusing to keep seeing sstate summary messages when hash equivalency is
active. This adds an option to control it. A default value is given which
maintains compatibility with different bitbake versions.

(From OE-Core rev: 038004866ff6650bcff7bb1bde36de6c0f451d29)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2019-11-04 17:28:58 +00:00
parent 61f5370c9b
commit f77b00c3f4
+12 -11
View File
@@ -818,7 +818,7 @@ sstate_unpack_package () {
BB_HASHCHECK_FUNCTION = "sstate_checkhashes" BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs): def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs):
found = set() found = set()
missed = set() missed = set()
extension = ".tgz" extension = ".tgz"
@@ -951,16 +951,17 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs):
evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) ) 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) bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
# Print some summary statistics about the current task completion and how much sstate if summary:
# reuse there was. Avoid divide by zero errors. # Print some summary statistics about the current task completion and how much sstate
total = len(sq_data['hash']) # reuse there was. Avoid divide by zero errors.
complete = 0 total = len(sq_data['hash'])
if currentcount: complete = 0
complete = (len(found) + currentcount) / (total + currentcount) * 100 if currentcount:
match = 0 complete = (len(found) + currentcount) / (total + currentcount) * 100
if total: match = 0
match = len(found) / total * 100 if total:
bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete)) match = len(found) / total * 100
bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete))
if hasattr(bb.parse.siggen, "checkhashes"): if hasattr(bb.parse.siggen, "checkhashes"):
bb.parse.siggen.checkhashes(sq_data, missed, found, d) bb.parse.siggen.checkhashes(sq_data, missed, found, d)