All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] hob: handle sanity check failures as a separate event
@ 2012-05-28 17:10 Paul Eggleton
  2012-05-28 17:10 ` [PATCH 1/1] " Paul Eggleton
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2012-05-28 17:10 UTC (permalink / raw)
  To: bitbake-devel

The following change (against Poky, but applies cleanly with -p2 against
BitBake master) is available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/hob-sanity
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/hob-sanity

Paul Eggleton (1):
  hob: handle sanity check failures as a separate event

 bitbake/lib/bb/event.py                     |    8 ++++++++
 bitbake/lib/bb/ui/crumbs/builder.py         |    7 ++++++-
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    6 ++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

-- 
1.7.9.5




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] hob: handle sanity check failures as a separate event
  2012-05-28 17:10 [PATCH 0/1] hob: handle sanity check failures as a separate event Paul Eggleton
@ 2012-05-28 17:10 ` Paul Eggleton
  2012-05-30 16:20   ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggleton @ 2012-05-28 17:10 UTC (permalink / raw)
  To: bitbake-devel

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>
---
 bitbake/lib/bb/event.py                     |    8 ++++++++
 bitbake/lib/bb/ui/crumbs/builder.py         |    7 ++++++-
 bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    6 ++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index f3fb521..1116c0a 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/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/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 80a8d01..8d35ea9 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):
         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/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index b34bdbe..1db9c44 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):
          "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'
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] hob: handle sanity check failures as a separate event
  2012-05-28 17:10 ` [PATCH 1/1] " Paul Eggleton
@ 2012-05-30 16:20   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-05-30 16:20 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: bitbake-devel

On Mon, 2012-05-28 at 18:10 +0100, Paul Eggleton wrote:
> 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>
> ---
>  bitbake/lib/bb/event.py                     |    8 ++++++++
>  bitbake/lib/bb/ui/crumbs/builder.py         |    7 ++++++-
>  bitbake/lib/bb/ui/crumbs/hobeventhandler.py |    6 ++++++
>  3 files changed, 20 insertions(+), 1 deletion(-)

Merged to master, thanks.

Richard





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-30 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28 17:10 [PATCH 0/1] hob: handle sanity check failures as a separate event Paul Eggleton
2012-05-28 17:10 ` [PATCH 1/1] " Paul Eggleton
2012-05-30 16:20   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.