diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-08-09 11:09:38 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-11 19:07:58 +0100 |
commit | 858c79c3e98019dd525c8a2cd6a99319b583a4f4 (patch) | |
tree | c7d4d9e79657e5227ab43089dfad483401319e8a | |
parent | 786033f53cad2a196ae6f3a05574148578ea3894 (diff) | |
download | poky-858c79c3e98019dd525c8a2cd6a99319b583a4f4.tar.gz |
bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark()
Two similarly named variables in the mark() method resulted in the wrong
variable being used in a couple of places. This patch adresses this in
several ways:
1) Renames the variables to be less similar
2) Uses the correct variables
3) Adds some coments to document the methods intent
Partially addresses [YOCTO #1355]
(Bitbake rev: ba9f2fe496eec0a221b563ffc9bb76eca592192f)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/tasklistmodel.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py index 3e097579fa..96814c217d 100644 --- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py | |||
@@ -316,9 +316,13 @@ class TaskListModel(gtk.ListStore): | |||
316 | def mark(self, opath): | 316 | def mark(self, opath): |
317 | usersel = {} | 317 | usersel = {} |
318 | removed = [] | 318 | removed = [] |
319 | |||
319 | it = self.get_iter_first() | 320 | it = self.get_iter_first() |
320 | name = self[opath][self.COL_NAME] | 321 | # The name of the item we're removing, so that we can use it to find |
322 | # other items which either depend on it, or were brought in by it | ||
323 | marked_name = self[opath][self.COL_NAME] | ||
321 | 324 | ||
325 | # Remove the passed item | ||
322 | self.remove_item_path(opath) | 326 | self.remove_item_path(opath) |
323 | 327 | ||
324 | # Remove all dependent packages, update binb | 328 | # Remove all dependent packages, update binb |
@@ -330,7 +334,7 @@ class TaskListModel(gtk.ListStore): | |||
330 | deps = self[path][self.COL_DEPS] | 334 | deps = self[path][self.COL_DEPS] |
331 | binb = self[path][self.COL_BINB] | 335 | binb = self[path][self.COL_BINB] |
332 | itype = self[path][self.COL_TYPE] | 336 | itype = self[path][self.COL_TYPE] |
333 | iname = self[path][self.COL_NAME] | 337 | itname = self[path][self.COL_NAME] |
334 | 338 | ||
335 | # We ignore anything that isn't a package | 339 | # We ignore anything that isn't a package |
336 | if not itype == "package": | 340 | if not itype == "package": |
@@ -341,16 +345,20 @@ class TaskListModel(gtk.ListStore): | |||
341 | # is to save its name and re-mark it for inclusion once dependency | 345 | # is to save its name and re-mark it for inclusion once dependency |
342 | # processing is complete | 346 | # processing is complete |
343 | if binb == "User Selected": | 347 | if binb == "User Selected": |
344 | usersel[iname] = self[path][self.COL_IMG] | 348 | usersel[itname] = self[path][self.COL_IMG] |
345 | 349 | ||
350 | # If the iterated item is included and depends on the removed | ||
351 | # item it should also be removed. | ||
346 | # FIXME: need to ensure partial name matching doesn't happen | 352 | # FIXME: need to ensure partial name matching doesn't happen |
347 | if inc and deps.count(name) and name not in removed: | 353 | if inc and deps.count(marked_name) and itname not in removed: |
348 | # found a dependency, remove it | 354 | # found a dependency, remove it |
349 | removed.append(name) | 355 | removed.append(itname) |
350 | self.mark(path) | 356 | self.mark(path) |
351 | 357 | ||
352 | if inc and binb.count(name): | 358 | # If the iterated item was brought in by the removed (passed) item |
353 | bib = self.find_alt_dependency(name) | 359 | # try and find an alternative dependee and update the binb column |
360 | if inc and binb.count(marked_name): | ||
361 | bib = self.find_alt_dependency(itname) | ||
354 | self[path][self.COL_BINB] = bib | 362 | self[path][self.COL_BINB] = bib |
355 | 363 | ||
356 | # Re-add any removed user selected items | 364 | # Re-add any removed user selected items |