]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: only search on the mirrors for the missing files
authorJose Quaresma <quaresma.jose@gmail.com>
Tue, 9 Nov 2021 11:11:47 +0000 (11:11 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 16 Nov 2021 22:19:47 +0000 (22:19 +0000)
The existence of missed files on the local sstate cache is the
condition to search for it on the sstate mirror.
The missed collection are populated when we search the files
on the local sstate cache.

- When we have sstate mirrors we don't need to iterate all files
again because we already know what's missing.

- When we found a file on the sstate mirror is because of they
are missing on the local sstate mirror.
So avoid checking if the hash exists on the missed collection.

- When we can't find the file on the sstate mirror we don't need
to add the hash again to the missed collection as it already exists.

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass

index 3f6a1fe99f8d68ba4a9410cbc0f58f2b7fe15086..88bd84a06c1ad478eabdf41d69b5ad9cc78cd537 100644 (file)
@@ -989,10 +989,8 @@ 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)
-                if tid in missed:
-                    missed.remove(tid)
+                missed.remove(tid)
             except bb.fetch2.FetchError as e:
-                missed.add(tid)
                 bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)" % (srcuri, e))
             except Exception as e:
                 bb.error("SState: cannot test %s: %s" % (srcuri, e))
@@ -1001,9 +999,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d)
 
         tasklist = []
-        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))