Patchwork [bitbake-devel,3/3] hob: deal event DiskFull

login
register
mail settings
Submitter Kang Kai
Date July 26, 2012, 9:39 a.m.
Message ID <31bb014339e82f1c17129fd1e7ab3b8448fc2a3d.1343295453.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/33117/
State New
Headers show

Comments

Kang Kai - July 26, 2012, 9:39 a.m.
When bitbake runqueue is teminated by disk monitor, it will send event
DiskFull. Update to handle it.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py      |    4 ++++
 bitbake/lib/bb/ui/crumbs/runningbuild.py |   11 +++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

Patch

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