* [PATCH 1/4] ui/crumbs/tasklistmodel: work around overly aggressive package removal
2011-07-27 3:57 [PATCH 0/4] Hob bug fixes Joshua Lock
@ 2011-07-27 3:57 ` Joshua Lock
2011-07-27 3:57 ` [PATCH 2/4] hob: fix loading customised image recipe Joshua Lock
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-27 3:57 UTC (permalink / raw)
To: bitbake-devel
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].
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
lib/bb/ui/crumbs/tasklistmodel.py | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index ee6ebf8..d7dff3c 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -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.
--
1.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/4] hob: fix loading customised image recipe
2011-07-27 3:57 [PATCH 0/4] Hob bug fixes Joshua Lock
2011-07-27 3:57 ` [PATCH 1/4] ui/crumbs/tasklistmodel: work around overly aggressive package removal Joshua Lock
@ 2011-07-27 3:57 ` Joshua Lock
2011-07-27 3:57 ` [PATCH 3/4] cooker: populate rdepends-pkg in generatePkgDepTreeData Joshua Lock
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-27 3:57 UTC (permalink / raw)
To: bitbake-devel
The 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]
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
lib/bb/ui/crumbs/tasklistmodel.py | 2 +-
lib/bb/ui/hob.py | 6 ++++++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index d7dff3c..e190f96 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -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)
diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index d3442c5..90d5c5a 100644
--- a/lib/bb/ui/hob.py
+++ b/lib/bb/ui/hob.py
@@ -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()
--
1.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/4] cooker: populate rdepends-pkg in generatePkgDepTreeData
2011-07-27 3:57 [PATCH 0/4] Hob bug fixes Joshua Lock
2011-07-27 3:57 ` [PATCH 1/4] ui/crumbs/tasklistmodel: work around overly aggressive package removal Joshua Lock
2011-07-27 3:57 ` [PATCH 2/4] hob: fix loading customised image recipe Joshua Lock
@ 2011-07-27 3:57 ` Joshua Lock
2011-07-27 3:57 ` [PATCH 4/4] ui/crumbs/hobprefs: trigger reparse when package format changed Joshua Lock
2011-07-27 15:49 ` [PATCH 0/4] Hob bug fixes Richard Purdie
4 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-27 3:57 UTC (permalink / raw)
To: bitbake-devel
The 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.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
lib/bb/cooker.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 1f305d9..146c211 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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:
--
1.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/4] ui/crumbs/hobprefs: trigger reparse when package format changed
2011-07-27 3:57 [PATCH 0/4] Hob bug fixes Joshua Lock
` (2 preceding siblings ...)
2011-07-27 3:57 ` [PATCH 3/4] cooker: populate rdepends-pkg in generatePkgDepTreeData Joshua Lock
@ 2011-07-27 3:57 ` Joshua Lock
2011-07-27 15:49 ` [PATCH 0/4] Hob bug fixes Richard Purdie
4 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-27 3:57 UTC (permalink / raw)
To: bitbake-devel
From: Jessica Zhang <jessica.zhang@intel.com>
reload_data after package format change to make the change take effects in
next build.
Fixes [YOCTO #1287].
Signed-off-by: Jessica Zhang <jessica.zhang@intel.com>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
lib/bb/ui/crumbs/hobprefs.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lib/bb/ui/crumbs/hobprefs.py b/lib/bb/ui/crumbs/hobprefs.py
index 1e6c78b..0f9bda2 100644
--- a/lib/bb/ui/crumbs/hobprefs.py
+++ b/lib/bb/ui/crumbs/hobprefs.py
@@ -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
--
1.7.6
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/4] Hob bug fixes
2011-07-27 3:57 [PATCH 0/4] Hob bug fixes Joshua Lock
` (3 preceding siblings ...)
2011-07-27 3:57 ` [PATCH 4/4] ui/crumbs/hobprefs: trigger reparse when package format changed Joshua Lock
@ 2011-07-27 15:49 ` Richard Purdie
4 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2011-07-27 15:49 UTC (permalink / raw)
To: Joshua Lock; +Cc: bitbake-devel
On Tue, 2011-07-26 at 20:57 -0700, Joshua Lock wrote:
> 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
Merged to master, thanks.
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread