diff options
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/tasklistmodel.py | 25 |
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. |