summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-17 21:39:30 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-23 10:00:32 -0700
commitb6009b295267cb991eb5efbe863ed4e4c99fb715 (patch)
tree32580ad4db926b469b81aebb8005c9309a307eec /bitbake
parentd2f1ede68afa3a718bbf71b2739107667ecde37b (diff)
downloadpoky-b6009b295267cb991eb5efbe863ed4e4c99fb715.tar.gz
bb/ui/crumbs/tasklistmodel: store all binb, not just the first
This makes it easier for the user to determine what the effects of a removal may be, further it means we no longer need the find_alt_dependency method which could be a fairly time-consuming method depending on the size of the contents table. Partially addresses [YOCTO #1365] (Bitbake rev: 91d1f5f5a44c80e6702221509e2e9aadbe05bcc0) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/crumbs/tasklistmodel.py50
1 files changed, 17 insertions, 33 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
index b0f5d7a7b6..d2f49d1642 100644
--- a/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/tasklistmodel.py
@@ -350,7 +350,7 @@ class TaskListModel(gtk.ListStore):
350 350
351 inc = self[path][self.COL_INC] 351 inc = self[path][self.COL_INC]
352 deps = self[path][self.COL_DEPS] 352 deps = self[path][self.COL_DEPS]
353 binb = self[path][self.COL_BINB] 353 binb = self[path][self.COL_BINB].split(', ')
354 itype = self[path][self.COL_TYPE] 354 itype = self[path][self.COL_TYPE]
355 itname = self[path][self.COL_NAME] 355 itname = self[path][self.COL_NAME]
356 356
@@ -362,7 +362,7 @@ class TaskListModel(gtk.ListStore):
362 # we should keep it and its dependencies, the easiest way to do so 362 # we should keep it and its dependencies, the easiest way to do so
363 # is to save its name and re-mark it for inclusion once dependency 363 # is to save its name and re-mark it for inclusion once dependency
364 # processing is complete 364 # processing is complete
365 if binb == "User Selected": 365 if "User Selected" in binb:
366 usersel[itname] = self[path][self.COL_IMG] 366 usersel[itname] = self[path][self.COL_IMG]
367 367
368 # If the iterated item is included and depends on the removed 368 # If the iterated item is included and depends on the removed
@@ -376,8 +376,8 @@ class TaskListModel(gtk.ListStore):
376 # If the iterated item was brought in by the removed (passed) item 376 # If the iterated item was brought in by the removed (passed) item
377 # try and find an alternative dependee and update the binb column 377 # try and find an alternative dependee and update the binb column
378 if inc and marked_name in binb: 378 if inc and marked_name in binb:
379 bib = self.find_alt_dependency(itname) 379 binb.remove(marked_name)
380 self[path][self.COL_BINB] = bib 380 self[path][self.COL_BINB] = ', '.join(binb).lstrip(', ')
381 381
382 # Re-add any removed user selected items 382 # Re-add any removed user selected items
383 for u in usersel: 383 for u in usersel:
@@ -415,25 +415,6 @@ class TaskListModel(gtk.ListStore):
415 it = self.contents.iter_next(it) 415 it = self.contents.iter_next(it)
416 416
417 """ 417 """
418 Find the name of an item in the image contents which depends on the item
419 name.
420 Returns either an item name (str) or None
421 """
422 def find_alt_dependency(self, name):
423 it = self.contents.get_iter_first()
424 while it:
425 # iterate all items in the contents model
426 path = self.contents.get_path(it)
427 deps = self.contents[path][self.COL_DEPS]
428 itname = self.contents[path][self.COL_NAME]
429 inc = self.contents[path][self.COL_INC]
430 if itname != name and inc and name in deps:
431 # if this item depends on the item, return this items name
432 return itname
433 it = self.contents.iter_next(it)
434 return ""
435
436 """
437 Check the self.contents gtk.TreeModel for an item 418 Check the self.contents gtk.TreeModel for an item
438 where COL_NAME matches item_name 419 where COL_NAME matches item_name
439 Returns True if a match is found, False otherwise 420 Returns True if a match is found, False otherwise
@@ -456,7 +437,10 @@ class TaskListModel(gtk.ListStore):
456 cur_inc = self[item_path][self.COL_INC] 437 cur_inc = self[item_path][self.COL_INC]
457 if not cur_inc: 438 if not cur_inc:
458 self[item_path][self.COL_INC] = True 439 self[item_path][self.COL_INC] = True
459 self[item_path][self.COL_BINB] = binb 440
441 bin = self[item_path][self.COL_BINB].split(', ')
442 bin.append(binb)
443 self[item_path][self.COL_BINB] = ', '.join(bin).lstrip(', ')
460 444
461 # We want to do some magic with things which are brought in by the 445 # We want to do some magic with things which are brought in by the
462 # base image so tag them as so 446 # base image so tag them as so
@@ -469,16 +453,16 @@ class TaskListModel(gtk.ListStore):
469 # add all of the deps and set their binb to this item 453 # add all of the deps and set their binb to this item
470 for dep in deps.split(" "): 454 for dep in deps.split(" "):
471 # If the contents model doesn't already contain dep, add it 455 # If the contents model doesn't already contain dep, add it
472 # We only care to show things which will end up in the
473 # resultant image, so filter cross and native recipes
474 dep_included = self.contents_includes_name(dep) 456 dep_included = self.contents_includes_name(dep)
475 path = self.find_path_for_item(dep) 457 path = self.find_path_for_item(dep)
476 if not dep_included and path: 458 if not path:
477 self.include_item(path, name, image_contents) 459 continue
478 # Set brought in by for any no longer orphan packages 460 if dep_included:
479 elif dep_included and path: 461 bin = self[path][self.COL_BINB].split(', ')
480 if not self[path][self.COL_BINB]: 462 bin.append(name)
481 self[path][self.COL_BINB] = name 463 self[path][self.COL_BINB] = ', '.join(bin).lstrip(', ')
464 else:
465 self.include_item(path, binb=name, image_contents=image_contents)
482 466
483 """ 467 """
484 Find the model path for the item_name 468 Find the model path for the item_name
@@ -535,7 +519,7 @@ class TaskListModel(gtk.ListStore):
535 519
536 it = self.contents.get_iter_first() 520 it = self.contents.get_iter_first()
537 while it: 521 while it:
538 sel = self.contents.get_value(it, self.COL_BINB) == "User Selected" 522 sel = "User Selected" in self.contents.get_value(it, self.COL_BINB)
539 name = self.contents.get_value(it, self.COL_NAME) 523 name = self.contents.get_value(it, self.COL_NAME)
540 allpkgs.append(name) 524 allpkgs.append(name)
541 if sel: 525 if sel: