Return-Path: X-Greylist: delayed 546 seconds by postgrey-1.34 at layers.openembedded.org; Thu, 07 Dec 2017 14:49:01 UTC Received: from bastet.se.axis.com (bastet.se.axis.com [195.60.68.11]) by mail.openembedded.org (Postfix) with ESMTP id 6F68178563 for ; Thu, 7 Dec 2017 14:49:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 627231845E for ; Thu, 7 Dec 2017 15:39:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id iQcsXU4DjCay for ; Thu, 7 Dec 2017 15:39:54 +0100 (CET) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id 24CD0180E4 for ; Thu, 7 Dec 2017 15:39:54 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11A3A1E08F for ; Thu, 7 Dec 2017 15:39:54 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 067AA1E089 for ; Thu, 7 Dec 2017 15:39:54 +0100 (CET) Received: from thoth.se.axis.com (unknown [10.0.2.173]) by boulder03.se.axis.com (Postfix) with ESMTP for ; Thu, 7 Dec 2017 15:39:53 +0100 (CET) Received: from saur-2.se.axis.com (saur-2.se.axis.com [10.92.3.2]) by thoth.se.axis.com (Postfix) with ESMTP id EED73543 for ; Thu, 7 Dec 2017 15:39:53 +0100 (CET) Received: from saur-2.se.axis.com (localhost [127.0.0.1]) by saur-2.se.axis.com (8.14.5/8.14.5) with ESMTP id vB7Edr9V021368 for ; Thu, 7 Dec 2017 15:39:53 +0100 Received: (from pkj@localhost) by saur-2.se.axis.com (8.14.5/8.14.5/Submit) id vB7Edrgm021367 for openembedded-devel@lists.openembedded.org; Thu, 7 Dec 2017 15:39:53 +0100 From: Peter Kjellerstedt To: openembedded-devel@lists.openembedded.org Date: Thu, 7 Dec 2017 15:39:51 +0100 Message-Id: <20171207143951.21325-1-pkj@axis.com> X-Mailer: git-send-email 2.12.0 X-TM-AS-GCONF: 00 Subject: [PATCH] sstate.bbclass: Add progress bars when removing from the sysroots X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2017 14:49:01 -0000 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 --- meta/classes/sstate.bbclass | 36 ++++++++++++++++++++++-------------- 1 file 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) -- 2.12.0