Hob bug fixes
cover Hob bug fixes
All,
Some more bug fixes for the hob UI hoping to make it in before we freeze Poky for Yocto 1.1M3.
Thanks,
Joshua
The following changes since commit 2650be190afc05f9472aca8b11af99205a342838:
ui/crumbs/tasklistmodel: fix loading a saved recipe (2011-07-26 09:42:28 -0700)
are available in the git repository at:
git://github.com/incandescant/bitbake hob
https://github.com/incandescant/bitbake/tree/hob
Jessica Zhang (1):
ui/crumbs/hobprefs: trigger reparse when package format changed
Joshua Lock (3):
ui/crumbs/tasklistmodel: work around overly aggressive package
removal
hob: fix loading customised image recipe
cooker: populate rdepends-pkg in generatePkgDepTreeData
lib/bb/cooker.py | 3 +++ lib/bb/ui/crumbs/hobprefs.py | 1 + lib/bb/ui/crumbs/tasklistmodel.py | 27 +++++++++++++++++++++++---- lib/bb/ui/hob.py | 6 ++++++ 4 files changed, 33 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.6
PATCH 1/4 ui/crumbs/tasklistmodel: work around overly aggressive package removal
The mark() method, which removes dependent and rdependent items, is overly aggressive removing items which are actually required by user selected items and then causing a removal of those items. Because the data structures used are not fine grained enough to do more intelligent dependency tracking the simplest "fix" is to track removals which are marked as "User Selected" and re-add those (and therefore their dependencies) once the aggressive removal is completed.
Because the aggressive removal already ignores images and tasks this should make the removal behave as expected though certainly leaves area for improvement in future.
Fixes [YOCTO #1280].
--- lib/bb/ui/crumbs/tasklistmodel.py | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +22 -3
@@ -306,11 +306,15 @@ class TaskListModel(gtk.ListStore): self[path][self.COL_INC] = False """ - recursively called to mark the item at opath and any package which - depends on it for removal + Recursively called to mark the item at opath and any package which + depends on it for removal. + NOTE: This method dumbly removes user selected packages and since we don't + do significant reverse dependency tracking it's easier and simpler to save + the items marked as user selected and re-add them once the removal sweep is + complete. """ def mark(self, opath): - removals = [] + usersel = {} it = self.get_iter_first() name = self[opath][self.COL_NAME]
@@ -325,19 +329,34 @@ class TaskListModel(gtk.ListStore): deps = self[path][self.COL_DEPS] binb = self[path][self.COL_BINB] itype = self[path][self.COL_TYPE] + iname = self[path][self.COL_NAME] # We ignore anything that isn't a package if not itype == "package": continue + # If the user added this item and it's not the item we're removing + # we should keep it and its dependencies, the easiest way to do so + # is to save its name and re-mark it for inclusion once dependency + # processing is complete + if binb == "User Selected": + usersel[iname] = self[path][self.COL_IMG] + # FIXME: need to ensure partial name matching doesn't happen if inc and deps.count(name): # found a dependency, remove it self.mark(path) + if inc and binb.count(name): bib = self.find_alt_dependency(name) self[path][self.COL_BINB] = bib + # Re-add any removed user selected items + for u in usersel: + npath = self.find_path_for_item(u) + self.include_item(item_path=npath, + binb="User Selected", + image_contents=usersel[u]) """ 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.
Signature · 1 line
1.7.6
PATCH 2/4 hob: fix loading customised image recipe
In reply to Joshua LockThe signal handler of the 'Base image' combo was still connected during load such that updating the UI to reflect the loaded base image triggered a change of the model. Fix this by disconnecting the signal handler when updating the displayed 'Base image'.
Fixes [YOCTO #1282]
--- lib/bb/ui/crumbs/tasklistmodel.py | 2 +- lib/bb/ui/hob.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-)
lib/bb/ui/crumbs/tasklistmodel.py +1 -1
@@ -281,7 +281,7 @@ class TaskListModel(gtk.ListStore): path = self.get_path(it) name = self[path][self.COL_NAME] if name in packages: - self.include_item(path) + self.include_item(path, binb="User Selected") packages.remove(name) it = self.iter_next(it)
lib/bb/ui/hob.py +6 -0
@@ -122,6 +122,10 @@ class MainWindow (gtk.Window): self.build_succeeded = False def image_changed_string_cb(self, model, new_image): + # disconnect the image combo's signal handler + if self.image_combo_id: + self.image_combo.disconnect(self.image_combo_id) + self.image_combo_id = None cnt = 0 it = self.model.images.get_iter_first() while it:
@@ -131,6 +135,8 @@ class MainWindow (gtk.Window): break 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) def image_changed_cb(self, combo): model = self.image_combo.get_model()
Signature · 1 line
1.7.6
PATCH 3/4 cooker: populate rdepends-pkg in generatePkgDepTreeData
In reply to Joshua LockThe rdepends-pkg field of the generated depend_tree model was not populated in the original implementation of this method, this series adds in the loop to populate the rdepends-pkg column of the model.
--- lib/bb/cooker.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
lib/bb/cooker.py +3 -0
@@ -452,6 +452,9 @@ class BBCooker: rdepends = self.status.rundeps[fn] for package in rdepends: + depend_tree["rdepends-pkg"][package] = [] + for rdepend in rdepends[package]: + depend_tree["rdepends-pkg"][package].append(rdepend) packages.append(package) for package in packages:
Signature · 1 line
1.7.6
PATCH 4/4 ui/crumbs/hobprefs: trigger reparse when package format changed
In reply to Joshua LockFrom: Jessica Zhang <[email protected]>
reload_data after package format change to make the change take effects in next build.
Fixes [YOCTO #1287].
--- lib/bb/ui/crumbs/hobprefs.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
lib/bb/ui/crumbs/hobprefs.py +1 -0
@@ -93,6 +93,7 @@ class HobPrefs(gtk.Dialog): self.curr_package_format = package_format self.configurator.setLocalConfVar('PACKAGE_CLASSES', 'package_%s' % package_format) handler.set_package_format(package_format) + self.reload_required = True def update_package_formats(self, handler, formats): active = 0
Signature · 1 line
1.7.6
Richard Purdie
AppliedQuoted 16 lines · Joshua Lock
All,
Some more bug fixes for the hob UI hoping to make it in before we freeze Poky for Yocto 1.1M3.
Thanks,
JoshuaThe following changes since commit
2650be190afc05f9472aca8b11af99205a342838:ui/crumbs/tasklistmodel: fix loading a saved recipe (2011-07-26 09:42:28 -0700)
are available in the git repository at:
git://github.com/incandescant/bitbakehob
https://github.com/incandescant/bitbake/tree/hob
Quoted 8 lines
Jessica Zhang (1):
ui/crumbs/hobprefs: trigger reparse when package format changedJoshua Lock (3):
ui/crumbs/tasklistmodel: work around overly aggressive package
removal
hob: fix loading customised image recipe
cooker: populate rdepends-pkg in generatePkgDepTreeData
Merged to master, thanks.
Richard