mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
sstate.bbclass: Add progress bars when removing from the sysroots
If there are many recipes that should be cleaned out from the sysroots, it can actually take some time. This adds a progress bar to give a visual clue that the clean up is actually progressing. (From OE-Core rev: d9b59df1230a20c7a5c9f4fb0325bb9216025a16) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
2ff88ae0e0
commit
75538b54d9
@@ -845,7 +845,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
|
|||||||
missed.append(task)
|
missed.append(task)
|
||||||
bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
|
bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
|
||||||
pass
|
pass
|
||||||
bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d)
|
bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d)
|
||||||
|
|
||||||
tasklist = []
|
tasklist = []
|
||||||
for task in range(len(sq_fn)):
|
for task in range(len(sq_fn)):
|
||||||
@@ -856,7 +856,8 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
|
|||||||
tasklist.append((task, sstatefile))
|
tasklist.append((task, sstatefile))
|
||||||
|
|
||||||
if tasklist:
|
if tasklist:
|
||||||
bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d)
|
msg = "Checking sstate mirror object availability"
|
||||||
|
bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
|
||||||
|
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
nproc = min(multiprocessing.cpu_count(), len(tasklist))
|
nproc = min(multiprocessing.cpu_count(), len(tasklist))
|
||||||
@@ -870,7 +871,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
|
|||||||
pool.wait_completion()
|
pool.wait_completion()
|
||||||
bb.event.disable_threadlock()
|
bb.event.disable_threadlock()
|
||||||
|
|
||||||
bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
|
bb.event.fire(bb.event.ProcessFinished(msg), d)
|
||||||
|
|
||||||
inheritlist = d.getVar("INHERIT")
|
inheritlist = d.getVar("INHERIT")
|
||||||
if "toaster" in inheritlist:
|
if "toaster" in inheritlist:
|
||||||
@@ -1038,18 +1039,25 @@ python sstate_eventhandler2() {
|
|||||||
seen.append(stamp)
|
seen.append(stamp)
|
||||||
|
|
||||||
if toremove:
|
if toremove:
|
||||||
bb.note("There are %d recipes to be removed from sysroot %s, removing..." % (len(toremove), a))
|
msg = "Removing %d recipes from the %s sysroot" % (len(toremove), a)
|
||||||
|
bb.event.fire(bb.event.ProcessStarted(msg, len(toremove)), d)
|
||||||
|
|
||||||
|
removed = 0
|
||||||
|
for r in toremove:
|
||||||
|
(stamp, manifest, workdir) = r.split()
|
||||||
|
for m in glob.glob(manifest + ".*"):
|
||||||
|
if m.endswith(".postrm"):
|
||||||
|
continue
|
||||||
|
sstate_clean_manifest(m, d)
|
||||||
|
bb.utils.remove(stamp + "*")
|
||||||
|
if removeworkdir:
|
||||||
|
bb.utils.remove(workdir, recurse = True)
|
||||||
|
lines.remove(r)
|
||||||
|
removed = removed + 1
|
||||||
|
bb.event.fire(bb.event.ProcessProgress(msg, removed), d)
|
||||||
|
|
||||||
|
bb.event.fire(bb.event.ProcessFinished(msg), d)
|
||||||
|
|
||||||
for r in toremove:
|
|
||||||
(stamp, manifest, workdir) = r.split()
|
|
||||||
for m in glob.glob(manifest + ".*"):
|
|
||||||
if m.endswith(".postrm"):
|
|
||||||
continue
|
|
||||||
sstate_clean_manifest(m, d)
|
|
||||||
bb.utils.remove(stamp + "*")
|
|
||||||
if removeworkdir:
|
|
||||||
bb.utils.remove(workdir, recurse = True)
|
|
||||||
lines.remove(r)
|
|
||||||
with open(i, "w") as f:
|
with open(i, "w") as f:
|
||||||
for l in lines:
|
for l in lines:
|
||||||
f.write(l)
|
f.write(l)
|
||||||
|
|||||||
Reference in New Issue
Block a user