summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
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:23:31 +0100
commit5a975239eabe1f1e5f03d3fb10fd7d31929f35aa (patch)
tree0e0935b436fe70db87ed2fd0ec250b15d696e6a3 /bitbake/lib/bb/ui
parentc8d78b21863d4fee0a0f330f835f4561dc2d5021 (diff)
downloadpoky-5a975239eabe1f1e5f03d3fb10fd7d31929f35aa.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]. (Bitbake rev: 24b631acdaa143a4de39c6e1328849660c66f219) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py7
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py6
2 files changed, 12 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 80a8d0160a..8d35ea96be 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -424,6 +424,7 @@ class Builder(gtk.Window):
424 self.handler.connect("data-generated", self.handler_data_generated_cb) 424 self.handler.connect("data-generated", self.handler_data_generated_cb)
425 self.handler.connect("command-succeeded", self.handler_command_succeeded_cb) 425 self.handler.connect("command-succeeded", self.handler_command_succeeded_cb)
426 self.handler.connect("command-failed", self.handler_command_failed_cb) 426 self.handler.connect("command-failed", self.handler_command_failed_cb)
427 self.handler.connect("sanity-failed", self.handler_sanity_failed_cb)
427 self.handler.connect("recipe-populated", self.handler_recipe_populated_cb) 428 self.handler.connect("recipe-populated", self.handler_recipe_populated_cb)
428 self.handler.connect("package-populated", self.handler_package_populated_cb) 429 self.handler.connect("package-populated", self.handler_package_populated_cb)
429 430
@@ -727,10 +728,14 @@ class Builder(gtk.Window):
727 728
728 def handler_command_failed_cb(self, handler, msg): 729 def handler_command_failed_cb(self, handler, msg):
729 if msg: 730 if msg:
730 msg = msg.replace("your local.conf", "Settings")
731 self.show_error_dialog(msg) 731 self.show_error_dialog(msg)
732 self.reset() 732 self.reset()
733 733
734 def handler_sanity_failed_cb(self, handler, msg):
735 msg = msg.replace("your local.conf", "Settings")
736 self.show_error_dialog(msg)
737 self.reset()
738
734 def window_sensitive(self, sensitive): 739 def window_sensitive(self, sensitive):
735 self.image_configuration_page.machine_combo.set_sensitive(sensitive) 740 self.image_configuration_page.machine_combo.set_sensitive(sensitive)
736 self.image_configuration_page.image_combo.set_sensitive(sensitive) 741 self.image_configuration_page.image_combo.set_sensitive(sensitive)
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index b34bdbefd4..1db9c44295 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -42,6 +42,9 @@ class HobHandler(gobject.GObject):
42 "command-failed" : (gobject.SIGNAL_RUN_LAST, 42 "command-failed" : (gobject.SIGNAL_RUN_LAST,
43 gobject.TYPE_NONE, 43 gobject.TYPE_NONE,
44 (gobject.TYPE_STRING,)), 44 (gobject.TYPE_STRING,)),
45 "sanity-failed" : (gobject.SIGNAL_RUN_LAST,
46 gobject.TYPE_NONE,
47 (gobject.TYPE_STRING,)),
45 "generating-data" : (gobject.SIGNAL_RUN_LAST, 48 "generating-data" : (gobject.SIGNAL_RUN_LAST,
46 gobject.TYPE_NONE, 49 gobject.TYPE_NONE,
47 ()), 50 ()),
@@ -170,6 +173,9 @@ class HobHandler(gobject.GObject):
170 elif isinstance(event, bb.event.SanityCheckPassed): 173 elif isinstance(event, bb.event.SanityCheckPassed):
171 self.run_next_command() 174 self.run_next_command()
172 175
176 elif isinstance(event, bb.event.SanityCheckFailed):
177 self.emit("sanity-failed", event._msg)
178
173 elif isinstance(event, logging.LogRecord): 179 elif isinstance(event, logging.LogRecord):
174 if event.levelno >= logging.ERROR: 180 if event.levelno >= logging.ERROR:
175 self.error_msg += event.msg + '\n' 181 self.error_msg += event.msg + '\n'