summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2017-12-07 15:50:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-10 22:41:43 +0000
commitd9b59df1230a20c7a5c9f4fb0325bb9216025a16 (patch)
treebaabb9a29d728118717f2a794eba74b99fb7f614
parentbfd9664edad7044b5da53fc33b8d0f6508f00950 (diff)
downloadopenembedded-core-contrib-d9b59df1230a20c7a5c9f4fb0325bb9216025a16.tar.gz
openembedded-core-contrib-d9b59df1230a20c7a5c9f4fb0325bb9216025a16.tar.bz2
openembedded-core-contrib-d9b59df1230a20c7a5c9f4fb0325bb9216025a16.zip
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. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass36
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)