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

login
register
mail settings
Submitter Kang Kai
Date July 27, 2012, 8:38 a.m.
Message ID <a962a88e17da8eaf8fc0bb98d83ba7db506526ee.1343378110.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/33181/
State New
Headers show

Comments

Kang Kai - July 27, 2012, 8:38 a.m.
Part of [Yocto #2168]

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, 14 insertions(+), 1 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..0347058 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,)),
@@ -93,6 +96,7 @@  class RunningBuild (gobject.GObject):
         gobject.GObject.__init__ (self)
         self.model = RunningBuildModel()
         self.sequential = sequential
+        self.buildaborted = False
 
     def reset (self):
         self.pids_to_task.clear()
@@ -274,7 +278,9 @@  class RunningBuild (gobject.GObject):
                                       0))
 
             # Emit the appropriate signal depending on the number of failures
-            if (failures >= 1):
+            if self.buildaborted:
+                self.emit ("build-aborted")
+            elif (failures >= 1):
                 self.emit ("build-failed")
             else:
                 self.emit ("build-succeeded")
@@ -286,6 +292,9 @@  class RunningBuild (gobject.GObject):
             if pbar:
                 pbar.set_text(event.msg)
 
+        elif isinstance(event, bb.event.DiskFull):
+            self.buildaborted = True
+
         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