summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2021-11-09 11:11:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-16 22:20:33 +0000
commit52b768d70085f1b408f59d5654209d9004fd3393 (patch)
tree6a8f068975a631d3d11ab7bfc173c749873df24f /meta/classes/sstate.bbclass
parentbcc9d8f837d6c1c69d1321e65aa5c74c6dd3dfab (diff)
downloadpoky-52b768d70085f1b408f59d5654209d9004fd3393.tar.gz
sstate: cleanup the sstate mirror progress check
We only have the progress bar when there are more than 100 objects. So we can check for this and store the result to show the progress bar. (From OE-Core rev: 18e7a77aa1626e11820804ad64b86a32f97da2ca) Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 849723d4dc..3f6a1fe99f 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -996,11 +996,11 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
996 bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)" % (srcuri, e)) 996 bb.debug(2, "SState: Unsuccessful fetch test for %s (%s)" % (srcuri, e))
997 except Exception as e: 997 except Exception as e:
998 bb.error("SState: cannot test %s: %s" % (srcuri, e)) 998 bb.error("SState: cannot test %s: %s" % (srcuri, e))
999 if len(tasklist) >= min_tasks: 999
1000 if progress:
1000 bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d) 1001 bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d)
1001 1002
1002 tasklist = [] 1003 tasklist = []
1003 min_tasks = 100
1004 for tid in sq_data['hash']: 1004 for tid in sq_data['hash']:
1005 if tid in found: 1005 if tid in found:
1006 continue 1006 continue
@@ -1011,7 +1011,8 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
1011 if tasklist: 1011 if tasklist:
1012 nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist)) 1012 nproc = min(int(d.getVar("BB_NUMBER_THREADS")), len(tasklist))
1013 1013
1014 if len(tasklist) >= min_tasks: 1014 progress = len(tasklist) >= 100
1015 if progress:
1015 msg = "Checking sstate mirror object availability" 1016 msg = "Checking sstate mirror object availability"
1016 bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d) 1017 bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
1017 1018
@@ -1024,7 +1025,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
1024 pool.wait_completion() 1025 pool.wait_completion()
1025 bb.event.disable_threadlock() 1026 bb.event.disable_threadlock()
1026 1027
1027 if len(tasklist) >= min_tasks: 1028 if progress:
1028 bb.event.fire(bb.event.ProcessFinished(msg), d) 1029 bb.event.fire(bb.event.ProcessFinished(msg), d)
1029 1030
1030 inheritlist = d.getVar("INHERIT") 1031 inheritlist = d.getVar("INHERIT")