[PATCH 2/5] sstate.bbclass: only search on the mirrors for the missing files

Jose Quaresma
2021-08-09T09:49:14Z

On the first search we found some files on the local sstate cache.
The missing files are know as well when this step finish.
When we have sstate mirrors we don't need to iterate all files again
because we already know what's missing.

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
meta/classes/sstate.bbclass | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 2575750247..c3c145e7f3 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -949,11 +949,8 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
foundMirrors += 1
found.add(tid)
-
- if tid in missed:
- missed.remove(tid)
+ missed.remove(tid)
except:
- missed.add(tid)
bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
pass
if len(tasklist) >= min_tasks:
@@ -961,9 +958,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,

tasklist = []
min_tasks = 100
- for tid in sq_data['hash']:
- if tid in found:
- continue
+ for tid in missed:
spec, extrapath, tname = getpathcomponents(tid, d)
sstatefile = d.expand(extrapath + generate_sstatefn(spec, gethash(tid), tname, siginfo, d))
tasklist.append((tid, sstatefile))
--
2.32.0