Skip to contentSkip to conversation

Hob fixes

PATCH Applied Joshua Lock 2 participants 8 messages Jul 21, 2011 Arm STM32

lore
Share & tools
lore
#0 lore raw

cover Hob fixes

This includes several fixes which are low impact for the core BitBake functionality (only touch files in lib/ui/crumbs and the hob entry point) but which improve the usefulness of the GUI whilst the reparseFiles/stashed copy of the environment issue is being worked through.

The following changes since commit 09a9146262d58dfe4a2ea4270026b90ae33f6c91:

parse/ConfHandler: Fix multiline variable corruption (2011-07-21 11:08:19 +0100)

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

Joshua Lock (6):
ui/crumbs/hobprefs: add missing import ui/crumbs/tasklistmodel: fix saving recipes
ui/hob: add more guidance to the stop dialog ui/crumbs/configurator: write new lines after new entries ui/hob: don't crash if PARALLEL_MAKE doesn't include a space ui/crumbs/tasklistmodel: ignore tasks and images when marking
dependencies

 lib/bb/ui/crumbs/configurator.py  |    2 +-
 lib/bb/ui/crumbs/hobprefs.py      |    1 +
 lib/bb/ui/crumbs/tasklistmodel.py |   24 ++++++++++++++++++------
 lib/bb/ui/hob.py                  |   11 +++++++++--
 4 files changed, 29 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.6
#4 lore raw

PATCH 4/6 ui/crumbs/configurator: write new lines after new entries

New entries written to a configuration file should be on separate lines, ensure this is the case by appending a newline to each written variable.

---
 lib/bb/ui/crumbs/configurator.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/configurator.py +1 -1
index b694143..5511799 100644
@@ -228,7 +228,7 @@ class Configurator(gobject.GObject):
                 cnt = cnt + 1
 
             if not replaced:
-                new_config_lines.append("%s = \"%s\"" % (var, changed_values[var]))
+                new_config_lines.append("%s = \"%s\"\n" % (var, changed_values[var]))
 
         # Add the modified variables
         config_lines.extend(new_config_lines)
Signature · 1 line
1.7.6
#3 lore raw

PATCH 3/6 ui/hob: add more guidance to the stop dialog

In reply to Joshua Lock

This patch adds explanation of the different options when asking the user to choose between Stop and Force Stop so they can make an informed choice.

Fixes [YOCTO #1223]

---
 lib/bb/ui/hob.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
lib/bb/ui/hob.py +8 -1
index 06d936e..aed7eac 100644
@@ -650,7 +650,14 @@ class MainWindow (gtk.Window):
         return vbox
 
     def cancel_build(self, button):
-        lbl = "<b>Stop build?</b>\n\nAre you sure you want to stop this build?"
+        lbl = "<b>Stop build?</b>\n\nAre you sure you want to stop this build?\n"
+        lbl = lbl + "'Force Stop' will stop the build as quickly as"
+        lbl = lbl + " possible but may well leave your build directory in an"
+        lbl = lbl + " unusable state that requires manual steps to fix.\n"
+        lbl = lbl + "'Stop' will stop the build as soon as all in"
+        lbl = lbl + " progress build tasks are finished. However if a"
+        lbl = lbl + " lengthy compilation phase is in progress this may take"
+        lbl = lbl + " some time."
         dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING)
         dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
         dialog.add_button("Stop", gtk.RESPONSE_OK)
Signature · 1 line
1.7.6
#2 lore raw

PATCH 2/6 ui/crumbs/tasklistmodel: fix saving recipes

In reply to Joshua Lock

After switching to dynamically finding the relative path for the recipe file it's no longer to append .bb when inserting the require line into the saved recipe.

Fixes [YOCTO #1247]

---
 lib/bb/ui/crumbs/tasklistmodel.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +1 -2
index 633931d..e28dbe7 100644
@@ -53,11 +53,10 @@ class BuildRep(gobject.GObject):
         self.userpkgs = packages
 
     def writeRecipe(self, writepath, model):
-        # FIXME: Need a better way to determine meta_path...
         template = """
 # Recipe generated by the HOB
 
-require %s.bb
+require %s
 
 IMAGE_INSTALL += "%s"
 """
Signature · 1 line
1.7.6
#1 lore raw

PATCH 1/6 ui/crumbs/hobprefs: add missing import

In reply to Joshua Lock

glib.idle_add is used so the glib module must be imported

Fixes [YOCTO #1248]

---
 lib/bb/ui/crumbs/hobprefs.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobprefs.py +1 -0
index f186410..779c14a 100644
@@ -19,6 +19,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import gtk
+import glib
 from bb.ui.crumbs.configurator import Configurator
 
 class HobPrefs(gtk.Dialog):
Signature · 1 line
1.7.6
#5 lore raw

PATCH 5/6 ui/hob: don't crash if PARALLEL_MAKE doesn't include a space

In reply to Joshua Lock

Use string.strip() as a much safer method of turning the -j value into an int

Fixes [YOCTO #1244]

---
 lib/bb/ui/hob.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/bb/ui/hob.py +1 -1
index aed7eac..2df344f 100644
@@ -883,7 +883,7 @@ def main (server, eventHandler):
         # The PARALLEL_MAKE variable will be of the format: "-j 3" and we only
         # want a number for the spinner, so strip everything from the variable
         # up to and including the space
-        pmake = int(pmake[pmake.find(" ")+1:])
+        pmake = int(pmake.lstrip("-j "))
 
     image_types = server.runCommand(["getVariable", "IMAGE_TYPES"])
 
Signature · 1 line
1.7.6
#6 lore raw

PATCH 6/6 ui/crumbs/tasklistmodel: ignore tasks and images when marking dependencies

In reply to Joshua Lock

When calculating what dependencies are affected by the removal of an item we should ignore images and tasks as they are not constructs which make sense in the GUI.
E.g: if we don't ignore tasks and remove opkg from an image based on core-image-minimal the fact that opkg was brought in by task-core results in task-core and all of the packages it brought in being removed and, eventually, an empty image.

---
 lib/bb/ui/crumbs/tasklistmodel.py |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +17 -4
index e28dbe7..112fdde 100644
@@ -306,9 +306,16 @@ class TaskListModel(gtk.ListStore):
         # Remove all dependent packages, update binb
         while it:
             path = self.get_path(it)
+            it = self.iter_next(it)
+
             inc = self[path][self.COL_INC]
             deps = self[path][self.COL_DEPS]
             binb = self[path][self.COL_BINB]
+            itype = self[path][self.COL_TYPE]
+
+            # We ignore anything that isn't a package
+            if not itype == "package":
+                continue
 
             # FIXME: need to ensure partial name matching doesn't happen
             if inc and deps.count(name):
@@ -318,8 +325,6 @@ class TaskListModel(gtk.ListStore):
                 bib = self.find_alt_dependency(name)
                 self[path][self.COL_BINB] = bib
 
-            it = self.iter_next(it)
-
     """
     Remove items from contents if the have an empty COL_BINB (brought in by)
     caused by all packages they are a dependency of being removed.
@@ -488,10 +493,18 @@ class TaskListModel(gtk.ListStore):
         it = self.contents.get_iter_first()
 
         while it:
-            if self.contents.get_value(it, self.COL_DEPS).count(pn) != 0:
-                revdeps.append(self.contents.get_value(it, self.COL_NAME))
+            name = self.contents.get_value(it, self.COL_NAME)
+            itype = self.contents.get_value(it, self.COL_TYPE)
+            deps = self.contents.get_value(it, self.COL_DEPS)
+
             it = self.contents.iter_next(it)
 
+            if not itype == 'package':
+                continue
+
+            if deps.count(pn) != 0:
+                revdeps.append(name)
+
         if pn in revdeps:
             revdeps.remove(pn)
         return revdeps
Signature · 1 line
1.7.6
#7 lore raw
In reply to Joshua Lock
Quoted 13 lines · Joshua Lock

This includes several fixes which are low impact for the core BitBake functionality (only touch files in lib/ui/crumbs and the hob entry point) but which improve the usefulness of the GUI whilst the reparseFiles/stashed copy of the environment issue is being worked through.

The following changes since commit 09a9146262d58dfe4a2ea4270026b90ae33f6c91:

parse/ConfHandler: Fix multiline variable corruption (2011-07-21 11:08:19 +0100)

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

Quoted 8 lines

Joshua Lock (6):
ui/crumbs/hobprefs: add missing import ui/crumbs/tasklistmodel: fix saving recipes
ui/hob: add more guidance to the stop dialog ui/crumbs/configurator: write new lines after new entries ui/hob: don't crash if PARALLEL_MAKE doesn't include a space ui/crumbs/tasklistmodel: ignore tasks and images when marking
dependencies

Merged to master, thanks.

Richard