Skip to contentSkip to conversation

Bug fixes for hob

PATCH Applied Joshua Lock 2 participants 8 messages Aug 4, 2011 Arm STM32

lore
Share & tools
lore
#0 lore raw

cover Bug fixes for hob

A fairly small series of bug fixes for the hob UI, please review.

The following changes since commit 25ec13075855f7e321a9763682a8cd4ca09203cd:

bb/ui/crumbs/runningbuild: emit signal when command fails with exit signal (2011-08-02 18:12:46 -0700)

are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob

Joshua Lock (6):
bb/ui/hob: fix detection of whether GPLv3 is disabled bb/ui/crumbs/tasklistmodel: fix regex used for loading image recipes bb/ui/hob: prevent label on progress bar from changing rapidly when
loading
bb/ui/crumbs/hobeventhandler: use generic loading message once cache
loaded
bb/ui/hob: only connect to the changed signal of image_combo once bb/ui/hob: be clear that the image contents are an estimate

 lib/bb/ui/crumbs/hobeventhandler.py |    3 +-
 lib/bb/ui/crumbs/tasklistmodel.py   |    2 +-
 lib/bb/ui/hob.py                    |   39 ++++++++++++++++++++++++++---------
 3 files changed, 32 insertions(+), 12 deletions(-)
Signature · 1 line
1.7.6
#1 lore raw

PATCH 1/6 bb/ui/hob: fix detection of whether GPLv3 is disabled

Find returns -1 if the substring isn't found, so checking for the Truthiness of the return value is insufficient. An INCOMPATIBLE_LICENSE value which only includes GPLv3 will cause find to return 0, for example.

Fixes [YOCTO #1320]

---
 lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/hob.py +1 -1
index a770fc2..5998e6b 100644
@@ -954,7 +954,7 @@ def main (server, eventHandler):
 
     incompatible = server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"])
     gplv3disabled = False
-    if incompatible and incompatible.lower().find("gplv3"):
+    if incompatible and incompatible.lower().find("gplv3") != -1:
         gplv3disabled = True
 
     build_toolchain = bool(server.runCommand(["getVariable", "HOB_BUILD_TOOLCHAIN"]))
Signature · 1 line
1.7.6
#2 lore raw

PATCH 2/6 bb/ui/crumbs/tasklistmodel: fix regex used for loading image recipes

In reply to Joshua Lock

Fixes [YOCTO #1321]

---
 lib/bb/ui/crumbs/tasklistmodel.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +1 -1
index e190f96..8fb5683 100644
@@ -38,7 +38,7 @@ class BuildRep(gobject.GObject):
         with open(pathname, 'r') as f:
             contents = f.readlines()
 
-        pkg_pattern = "^\s*(IMAGE_INSTALL)\s*([+=.?]+)\s*(\"\S*\")"
+        pkg_pattern = "^\s*(IMAGE_INSTALL)\s*([+=.?]+)\s*(\".*?\")"
         img_pattern = "^\s*(require)\s+(\S+.bb)"
 
         for line in contents:
Signature · 1 line
1.7.6
#3 lore raw

PATCH 3/6 bb/ui/hob: prevent label on progress bar from changing rapidly when loading

In reply to Joshua Lock

Fixes [YOCTO #1240]

---
 lib/bb/ui/hob.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
lib/bb/ui/hob.py +2 -2
index 5998e6b..b8842a9 100644
@@ -240,7 +240,6 @@ class MainWindow (gtk.Window):
 
     def busy_idle_func(self):
         if self.generating:
-            self.progress.set_text("Loading...")
             self.progress.pulse()
             return True
         else:
@@ -253,12 +252,13 @@ class MainWindow (gtk.Window):
 
     def busy(self, handler):
         self.generating = True
+        self.progress.set_text("Loading...")
         self.set_busy_cursor()
         if self.image_combo_id:
             self.image_combo.disconnect(self.image_combo_id)
             self.image_combo_id = None
         self.progress.pulse()
-        gobject.timeout_add (200, self.busy_idle_func)
+        gobject.timeout_add (100, self.busy_idle_func)
         self.disable_widgets()
 
     def enable_widgets(self):
Signature · 1 line
1.7.6
#4 lore raw

PATCH 4/6 bb/ui/crumbs/hobeventhandler: use generic loading message once cache loaded

In reply to Joshua Lock
---
 lib/bb/ui/crumbs/hobeventhandler.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/hobeventhandler.py +2 -1
index e8265f1..2e0a999 100644
@@ -187,7 +187,7 @@ class HobHandler(gobject.GObject):
             pbar.set_text("Loading cache: %s/%s" % (event.current, bb.ui.crumbs.hobeventhandler.progress_total))
         elif isinstance(event, bb.event.CacheLoadCompleted):
             self.current_phase = None
-            pbar.set_text("Loading cache: %s/%s" % (bb.ui.crumbs.hobeventhandler.progress_total, bb.ui.crumbs.hobeventhandler.progress_total))
+            pbar.set_text("Loading...")
         elif isinstance(event, bb.event.ParseStarted):
             self.current_phase = "recipe parsing"
             if event.total == 0:
@@ -200,6 +200,7 @@ class HobHandler(gobject.GObject):
         elif isinstance(event, bb.event.ParseCompleted):
             self.current_phase = None
             pbar.set_fraction(1.0)
+            pbar.set_text("Loading...")
         elif isinstance(event, logging.LogRecord):
             format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
             if event.levelno >= format.CRITICAL:
Signature · 1 line
1.7.6
#5 lore raw

PATCH 5/6 bb/ui/hob: only connect to the changed signal of image_combo once

In reply to Joshua Lock
---
 lib/bb/ui/hob.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
lib/bb/ui/hob.py +7 -4
index b8842a9..5a4ac78 100644
@@ -158,7 +158,8 @@ class MainWindow (gtk.Window):
             it = self.model.images.iter_next(it)
             cnt = cnt + 1
         # Reconnect the signal handler
-        self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
+        if not self.image_combo_id:
+            self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
 
     def image_changed_cb(self, combo):
         model = self.image_combo.get_model()
@@ -321,11 +322,13 @@ class MainWindow (gtk.Window):
         return
 
     def reset_build(self):
-        self.image_combo.disconnect(self.image_combo_id)
-        self.image_combo_id = None
+        if self.image_combo_id:
+            self.image_combo.disconnect(self.image_combo_id)
+            self.image_combo_id = None
         self.image_combo.set_active(-1)
-        self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
         self.model.reset()
+        if not self.image_combo_id:
+            self.image_combo_id = self.image_combo.connect("changed", self.image_changed_cb)
 
     def layers_cb(self, action):
         resp = self.layers.run()
Signature · 1 line
1.7.6
#6 lore raw

PATCH 6/6 bb/ui/hob: be clear that the image contents are an estimate

In reply to Joshua Lock

Partially addresses [YOCTO #1263]

---
 lib/bb/ui/hob.py |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
lib/bb/ui/hob.py +19 -3
index 5a4ac78..a38868f 100644
@@ -804,6 +804,14 @@ class MainWindow (gtk.Window):
         menubar.show_all()
 
         return menubar
+
+    def info_button_clicked_cb(self, button):
+        info = "We cannot accurately predict the image contents before they are built so instead a best"
+        info = info + "  attempt at estimating what the image will contain is listed."
+        dialog = CrumbsDialog(self, info, gtk.STOCK_DIALOG_INFO)
+        dialog.add_buttons(gtk.STOCK_CLOSE, gtk.RESPONSE_OK)
+        resp = dialog.run()
+        dialog.destroy()
     
     def create_build_gui(self):
         vbox = gtk.VBox(False, 12)
@@ -847,11 +855,19 @@ class MainWindow (gtk.Window):
         ins.set_current_page(0)
         ins.show_all()
 
-        label = gtk.Label("Image contents:")
+        hbox = gtk.HBox(False, 1)
+        hbox.show()
+        label = gtk.Label("Estimated image contents:")
         self.model.connect("contents-changed", self.update_package_count_cb, label)
         label.set_property("xalign", 0.00)
         label.show()
-        vbox.pack_start(label, expand=False, fill=False, padding=6)
+        hbox.pack_start(label, expand=False, fill=False, padding=6)
+        info = gtk.Button("?")
+        info.set_tooltip_text("What does this mean?")
+        info.show()
+        info.connect("clicked", self.info_button_clicked_cb)
+        hbox.pack_start(info, expand=False, fill=False, padding=6)
+        vbox.pack_start(hbox, expand=False, fill=False, padding=6)
         con = self.contents()
         con.show()
         vbox.pack_start(con, expand=True, fill=True)
@@ -873,7 +889,7 @@ class MainWindow (gtk.Window):
         return vbox
 
     def update_package_count_cb(self, model, count, label):
-        lbl = "Image contents (%s packages):" % count
+        lbl = "Estimated image contents (%s packages):" % count
         label.set_text(lbl)
 
     def contents(self):
Signature · 1 line
1.7.6
#7 lore raw
In reply to Joshua Lock
Quoted 10 lines · Joshua Lock

A fairly small series of bug fixes for the hob UI, please review.

The following changes since commit 25ec13075855f7e321a9763682a8cd4ca09203cd:

bb/ui/crumbs/runningbuild: emit signal when command fails with exit signal (2011-08-02 18:12:46 -0700)

are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob

Quoted 10 lines

Joshua Lock (6):
bb/ui/hob: fix detection of whether GPLv3 is disabled bb/ui/crumbs/tasklistmodel: fix regex used for loading image recipes bb/ui/hob: prevent label on progress bar from changing rapidly when
loading
bb/ui/crumbs/hobeventhandler: use generic loading message once cache
loaded
bb/ui/hob: only connect to the changed signal of image_combo once bb/ui/hob: be clear that the image contents are an estimate

Merged to master, thanks.

Richard