From patchwork Thu Jul 26 09:39:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel,3/3] hob: deal event DiskFull Date: Thu, 26 Jul 2012 09:39:08 -0000 From: Kang Kai X-Patchwork-Id: 33117 Message-Id: <31bb014339e82f1c17129fd1e7ab3b8448fc2a3d.1343295453.git.kai.kang@windriver.com> To: Cc: bitbake-devel@lists.openembedded.org, Zhenfeng.Zhao@windriver.com When bitbake runqueue is teminated by disk monitor, it will send event DiskFull. Update to handle it. Signed-off-by: Kang Kai --- bitbake/lib/bb/ui/crumbs/builder.py | 4 ++++ bitbake/lib/bb/ui/crumbs/runningbuild.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 123608e..c2e7068 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -430,6 +430,7 @@ class Builder(gtk.Window): self.handler.build.connect("build-started", self.handler_build_started_cb) self.handler.build.connect("build-succeeded", self.handler_build_succeeded_cb) self.handler.build.connect("build-failed", self.handler_build_failed_cb) + self.handler.build.connect("build-aborted", self.handler_build_aborted_cb) self.handler.build.connect("task-started", self.handler_task_started_cb) self.handler.build.connect("log-error", self.handler_build_failure_cb) self.handler.build.connect("no-provider", self.handler_no_provider_cb) @@ -920,6 +921,9 @@ class Builder(gtk.Window): def handler_build_failed_cb(self, running_build): self.build_failed() + def handler_build_aborted_cb(self, running_build): + self.build_failed() + def handler_no_provider_cb(self, running_build, msg): dialog = CrumbsMessageDialog(self, Builder.interpret_markup(msg), gtk.STOCK_DIALOG_INFO) button = dialog.add_button("Close", gtk.RESPONSE_OK) diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 8cf36ee..7bb4982 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py @@ -76,6 +76,9 @@ class RunningBuild (gobject.GObject): 'build-complete' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), + 'build-aborted' : (gobject.SIGNAL_RUN_LAST, + gobject.TYPE_NONE, + ()), 'task-started' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)), @@ -286,6 +289,14 @@ class RunningBuild (gobject.GObject): if pbar: pbar.set_text(event.msg) + elif isinstance(event, bb.event.DiskFull): + self.emit("build-aborted") + self.emit("build-complete") + self.model.close_task_refresh() + print(pbar) + if pbar: + pbar.set_text(event.msg) + elif isinstance(event, bb.command.CommandFailed): if event.error.startswith("Exited with"): # If the command fails with an exit code we're done, emit the