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 | poky-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): | |||
| 845 | missed.append(task) | 845 | missed.append(task) |
| 846 | bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri) | 846 | bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri) |
| 847 | pass | 847 | pass |
| 848 | bb.event.fire(bb.event.ProcessProgress("Checking sstate mirror object availability", len(tasklist) - thread_worker.tasks.qsize()), d) | 848 | bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d) |
| 849 | 849 | ||
| 850 | tasklist = [] | 850 | tasklist = [] |
| 851 | for task in range(len(sq_fn)): | 851 | 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): | |||
| 856 | tasklist.append((task, sstatefile)) | 856 | tasklist.append((task, sstatefile)) |
| 857 | 857 | ||
| 858 | if tasklist: | 858 | if tasklist: |
| 859 | bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d) | 859 | msg = "Checking sstate mirror object availability" |
| 860 | bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d) | ||
| 860 | 861 | ||
| 861 | import multiprocessing | 862 | import multiprocessing |
| 862 | nproc = min(multiprocessing.cpu_count(), len(tasklist)) | 863 | 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): | |||
| 870 | pool.wait_completion() | 871 | pool.wait_completion() |
| 871 | bb.event.disable_threadlock() | 872 | bb.event.disable_threadlock() |
| 872 | 873 | ||
| 873 | bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d) | 874 | bb.event.fire(bb.event.ProcessFinished(msg), d) |
| 874 | 875 | ||
| 875 | inheritlist = d.getVar("INHERIT") | 876 | inheritlist = d.getVar("INHERIT") |
| 876 | if "toaster" in inheritlist: | 877 | if "toaster" in inheritlist: |
| @@ -1038,18 +1039,25 @@ python sstate_eventhandler2() { | |||
| 1038 | seen.append(stamp) | 1039 | seen.append(stamp) |
| 1039 | 1040 | ||
| 1040 | if toremove: | 1041 | if toremove: |
| 1041 | bb.note("There are %d recipes to be removed from sysroot %s, removing..." % (len(toremove), a)) | 1042 | msg = "Removing %d recipes from the %s sysroot" % (len(toremove), a) |
| 1043 | bb.event.fire(bb.event.ProcessStarted(msg, len(toremove)), d) | ||
| 1044 | |||
| 1045 | removed = 0 | ||
| 1046 | for r in toremove: | ||
| 1047 | (stamp, manifest, workdir) = r.split() | ||
| 1048 | for m in glob.glob(manifest + ".*"): | ||
| 1049 | if m.endswith(".postrm"): | ||
| 1050 | continue | ||
| 1051 | sstate_clean_manifest(m, d) | ||
| 1052 | bb.utils.remove(stamp + "*") | ||
| 1053 | if removeworkdir: | ||
| 1054 | bb.utils.remove(workdir, recurse = True) | ||
| 1055 | lines.remove(r) | ||
| 1056 | removed = removed + 1 | ||
| 1057 | bb.event.fire(bb.event.ProcessProgress(msg, removed), d) | ||
| 1058 | |||
| 1059 | bb.event.fire(bb.event.ProcessFinished(msg), d) | ||
| 1042 | 1060 | ||
| 1043 | for r in toremove: | ||
| 1044 | (stamp, manifest, workdir) = r.split() | ||
| 1045 | for m in glob.glob(manifest + ".*"): | ||
| 1046 | if m.endswith(".postrm"): | ||
| 1047 | continue | ||
| 1048 | sstate_clean_manifest(m, d) | ||
| 1049 | bb.utils.remove(stamp + "*") | ||
| 1050 | if removeworkdir: | ||
| 1051 | bb.utils.remove(workdir, recurse = True) | ||
| 1052 | lines.remove(r) | ||
| 1053 | with open(i, "w") as f: | 1061 | with open(i, "w") as f: |
| 1054 | for l in lines: | 1062 | for l in lines: |
| 1055 | f.write(l) | 1063 | f.write(l) |
