diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2017-12-07 15:50:08 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-10 22:45:20 +0000 |
commit | 75538b54d989baa9cf006b3cec03d1aafe8882cd (patch) | |
tree | 0eb426c2f62192683c30b40898c0eca1a7310f24 /meta/classes/sstate.bbclass | |
parent | 2ff88ae0e0c79ab29de8bb0c81679b2ecfb018bd (diff) | |
download | openembedded-core-contrib-75538b54d989baa9cf006b3cec03d1aafe8882cd.tar.gz |
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>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r-- | meta/classes/sstate.bbclass | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index e30fbe1280..6e41b56861 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -845,7 +845,7 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): missed.append(task) bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri) 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 = [] 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)) 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 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() 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") if "toaster" in inheritlist: @@ -1038,18 +1039,25 @@ python sstate_eventhandler2() { seen.append(stamp) 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: for l in lines: f.write(l) |