summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-25 20:32:53 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-27 16:54:03 +0100
commit6b109860bfa093b7f1fe7ddae2e60595d070735b (patch)
tree1cbc497b6e190a17a184a0ec9fc719d11760aa2c /bitbake/lib/bb
parent052f04e460f8d697083ae4875eb20edaee7748b5 (diff)
downloadpoky-6b109860bfa093b7f1fe7ddae2e60595d070735b.tar.gz
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]. (Bitbake rev: 1e1055262450de994202fc3e5943b8b19f628681) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/ui/crumbs/tasklistmodel.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index ee6ebf8754..d7dff3c053 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -306,11 +306,15 @@ class TaskListModel(gtk.ListStore):
306 self[path][self.COL_INC] = False 306 self[path][self.COL_INC] = False
307 307
308 """ 308 """
309 recursively called to mark the item at opath and any package which 309 Recursively called to mark the item at opath and any package which
310 depends on it for removal 310 depends on it for removal.
311 NOTE: This method dumbly removes user selected packages and since we don't
312 do significant reverse dependency tracking it's easier and simpler to save
313 the items marked as user selected and re-add them once the removal sweep is
314 complete.
311 """ 315 """
312 def mark(self, opath): 316 def mark(self, opath):
313 removals = [] 317 usersel = {}
314 it = self.get_iter_first() 318 it = self.get_iter_first()
315 name = self[opath][self.COL_NAME] 319 name = self[opath][self.COL_NAME]
316 320
@@ -325,19 +329,34 @@ class TaskListModel(gtk.ListStore):
325 deps = self[path][self.COL_DEPS] 329 deps = self[path][self.COL_DEPS]
326 binb = self[path][self.COL_BINB] 330 binb = self[path][self.COL_BINB]
327 itype = self[path][self.COL_TYPE] 331 itype = self[path][self.COL_TYPE]
332 iname = self[path][self.COL_NAME]
328 333
329 # We ignore anything that isn't a package 334 # We ignore anything that isn't a package
330 if not itype == "package": 335 if not itype == "package":
331 continue 336 continue
332 337
338 # If the user added this item and it's not the item we're removing
339 # we should keep it and its dependencies, the easiest way to do so
340 # is to save its name and re-mark it for inclusion once dependency
341 # processing is complete
342 if binb == "User Selected":
343 usersel[iname] = self[path][self.COL_IMG]
344
333 # FIXME: need to ensure partial name matching doesn't happen 345 # FIXME: need to ensure partial name matching doesn't happen
334 if inc and deps.count(name): 346 if inc and deps.count(name):
335 # found a dependency, remove it 347 # found a dependency, remove it
336 self.mark(path) 348 self.mark(path)
349
337 if inc and binb.count(name): 350 if inc and binb.count(name):
338 bib = self.find_alt_dependency(name) 351 bib = self.find_alt_dependency(name)
339 self[path][self.COL_BINB] = bib 352 self[path][self.COL_BINB] = bib
340 353
354 # Re-add any removed user selected items
355 for u in usersel:
356 npath = self.find_path_for_item(u)
357 self.include_item(item_path=npath,
358 binb="User Selected",
359 image_contents=usersel[u])
341 """ 360 """
342 Remove items from contents if the have an empty COL_BINB (brought in by) 361 Remove items from contents if the have an empty COL_BINB (brought in by)
343 caused by all packages they are a dependency of being removed. 362 caused by all packages they are a dependency of being removed.