aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-05-28 18:10:39 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 17:20:01 +0100
commit24b631acdaa143a4de39c6e1328849660c66f219 (patch)
tree7fec14f7e9819c99d3db609be722426423d02dfa
parentd848af637e9a14b627533bee65bf16f680dff854 (diff)
downloadbitbake-24b631acdaa143a4de39c6e1328849660c66f219.tar.gz
hob: handle sanity check failures as a separate event
In order to show a friendlier error message that does not bury the actual sanity error in our typical preamble about disabling sanity checks, use a separate event to indicate that sanity checks failed. This change is intended to work together with the related change to sanity.bbclass in OE-Core. Fixes [YOCTO #2336]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/event.py8
-rwxr-xr-xlib/bb/ui/crumbs/builder.py7
-rw-r--r--lib/bb/ui/crumbs/hobeventhandler.py6
3 files changed, 20 insertions, 1 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index f3fb5213b..1116c0a7b 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -527,3 +527,11 @@ class SanityCheckPassed(Event):
"""
Event to indicate sanity check is passed
"""
+
+class SanityCheckFailed(Event):
+ """
+ Event to indicate sanity check has failed
+ """
+ def __init__(self, msg):
+ Event.__init__(self)
+ self._msg = msg
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 80a8d0160..8d35ea96b 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -424,6 +424,7 @@ class Builder(gtk.Window):
self.handler.connect("data-generated", self.handler_data_generated_cb)
self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
self.handler.connect("command-failed", self.handler_command_failed_cb)
+ self.handler.connect("sanity-failed", self.handler_sanity_failed_cb)
self.handler.connect("recipe-populated", self.handler_recipe_populated_cb)
self.handler.connect("package-populated", self.handler_package_populated_cb)
@@ -727,10 +728,14 @@ class Builder(gtk.Window):
def handler_command_failed_cb(self, handler, msg):
if msg:
- msg = msg.replace("your local.conf", "Settings")
self.show_error_dialog(msg)
self.reset()
+ def handler_sanity_failed_cb(self, handler, msg):
+ msg = msg.replace("your local.conf", "Settings")
+ self.show_error_dialog(msg)
+ self.reset()
+
def window_sensitive(self, sensitive):
self.image_configuration_page.machine_combo.set_sensitive(sensitive)
self.image_configuration_page.image_combo.set_sensitive(sensitive)
diff --git a/lib/bb/ui/crumbs/hobeventhandler.py b/lib/bb/ui/crumbs/hobeventhandler.py
index b34bdbefd..1db9c4429 100644
--- a/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/lib/bb/ui/crumbs/hobeventhandler.py
@@ -42,6 +42,9 @@ class HobHandler(gobject.GObject):
"command-failed" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(gobject.TYPE_STRING,)),
+ "sanity-failed" : (gobject.SIGNAL_RUN_LAST,
+ gobject.TYPE_NONE,
+ (gobject.TYPE_STRING,)),
"generating-data" : (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
@@ -170,6 +173,9 @@ class HobHandler(gobject.GObject):
elif isinstance(event, bb.event.SanityCheckPassed):
self.run_next_command()
+ elif isinstance(event, bb.event.SanityCheckFailed):
+ self.emit("sanity-failed", event._msg)
+
elif isinstance(event, logging.LogRecord):
if event.levelno >= logging.ERROR:
self.error_msg += event.msg + '\n'