summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass23
1 files changed, 12 insertions, 11 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index b47b9c23bf..64808f8e10 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -818,7 +818,7 @@ sstate_unpack_package () {
818 818
819BB_HASHCHECK_FUNCTION = "sstate_checkhashes" 819BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
820 820
821def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs): 821def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs):
822 found = set() 822 found = set()
823 missed = set() 823 missed = set()
824 extension = ".tgz" 824 extension = ".tgz"
@@ -951,16 +951,17 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, **kwargs):
951 evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) ) 951 evdata['found'].append((bb.runqueue.fn_from_tid(tid), bb.runqueue.taskname_from_tid(tid), gethash(tid), sstatefile ) )
952 bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d) 952 bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
953 953
954 # Print some summary statistics about the current task completion and how much sstate 954 if summary:
955 # reuse there was. Avoid divide by zero errors. 955 # Print some summary statistics about the current task completion and how much sstate
956 total = len(sq_data['hash']) 956 # reuse there was. Avoid divide by zero errors.
957 complete = 0 957 total = len(sq_data['hash'])
958 if currentcount: 958 complete = 0
959 complete = (len(found) + currentcount) / (total + currentcount) * 100 959 if currentcount:
960 match = 0 960 complete = (len(found) + currentcount) / (total + currentcount) * 100
961 if total: 961 match = 0
962 match = len(found) / total * 100 962 if total:
963 bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete)) 963 match = len(found) / total * 100
964 bb.plain("Sstate summary: Wanted %d Found %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(found), len(missed), currentcount, match, complete))
964 965
965 if hasattr(bb.parse.siggen, "checkhashes"): 966 if hasattr(bb.parse.siggen, "checkhashes"):
966 bb.parse.siggen.checkhashes(sq_data, missed, found, d) 967 bb.parse.siggen.checkhashes(sq_data, missed, found, d)