summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2021-10-03 22:54:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-23 17:41:46 +0100
commit0fe71f31593e87b9188b388860d2ba94bf8266bc (patch)
treed570989b9889ded7e9dd75d6bbefbe3e7f803e95 /meta/classes/sstate.bbclass
parentabf13cf886a50429b15d46e414112646cd935c2e (diff)
downloadopenembedded-core-contrib-0fe71f31593e87b9188b388860d2ba94bf8266bc.tar.gz
sstate.bbclass: count the files on mirrors using the pre local files
We don't need extra python collections to count the found files on the sstate cache and sstate mirrors. The main found collections provides all the files that were found. Then we only need to store the nunber of files that found on the local sstate cache and the files that found on the sstate cache mirror is derived from that. Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass11
1 files changed, 4 insertions, 7 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 3c179259e7..5736474f4c 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -912,8 +912,6 @@ BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True, **kwargs):
found = set()
- foundLocal = set()
- foundNet = set()
missed = set()
def gethash(task):
@@ -944,14 +942,13 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d))
if os.path.exists(sstatefile):
- bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
found.add(tid)
- foundLocal.add(tid)
- continue
+ bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
else:
missed.add(tid)
bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile)
+ foundLocal = len(found)
mirrors = d.getVar("SSTATE_MIRRORS")
if mirrors:
# Copy the data object and override DL_DIR and SRC_URI
@@ -992,7 +989,6 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
fetcher.checkstatus()
bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
found.add(tid)
- foundNet.add(tid)
if tid in missed:
missed.remove(tid)
except bb.fetch2.FetchError as e:
@@ -1054,7 +1050,8 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
match = 0
if total:
match = len(found) / total * 100
- bb.plain("Sstate summary: Wanted %d Local %d Network %d Missed %d Current %d (%d%% match, %d%% complete)" % (total, len(foundLocal), len(foundNet),len(missed), currentcount, match, complete))
+ bb.plain("Sstate summary: Wanted %d Local %d Mirrors %d Missed %d Current %d (%d%% match, %d%% complete)" %
+ (total, foundLocal, len(found)-foundLocal, len(missed), currentcount, match, complete))
if hasattr(bb.parse.siggen, "checkhashes"):
bb.parse.siggen.checkhashes(sq_data, missed, found, d)