diff options
author | Michael Wood <michael.g.wood@intel.com> | 2016-05-26 16:12:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-15 08:35:04 +0100 |
commit | dd764003ea2cb9449f838146183f17873a902e48 (patch) | |
tree | a0824c31ae2049a1784d91a8e1d7fe8735e3c6b7 /bitbake/lib/toaster/toastergui/tables.py | |
parent | 89433a35e6e21a978cef3e41e24d87024ed9a6ed (diff) | |
download | poky-dd764003ea2cb9449f838146183f17873a902e48.tar.gz |
bitbake: toaster: Rework displaying package dependencies across Toaster
After porting the build table to a unified mechanism for showing
dependencies in tables it highlighted that the dependencies selected to
be shown were un-filtered. i.e. all dependencies from all contexts were
shown. The context for a package's dependencies is based on the target
that they were installed onto, or if not installed then a "None" target.
Depending on where the template for the dependencies are show we need to
switch this target which is why a filter and utility function on the
model is added.
Additionally to use the same templates in the build analysis we also
need to optionally add links to the build data for the packages being
displayed as dependencies.
Customising a Custom image recipes may or may not have a target
depending on whether they have been built or not, if not we do a best
effort at getting the dependencies by using the last known target on
that package to get the dependency information.
[YOCTO #9676]
(Bitbake rev: 31e7c26cc31a7c8c78c1464fa01581683bfd2965)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tables.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 902f62f708..79673f5dab 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
@@ -22,7 +22,7 @@ | |||
22 | from toastergui.widgets import ToasterTable | 22 | from toastergui.widgets import ToasterTable |
23 | from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project | 23 | from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project |
24 | from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task | 24 | from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task |
25 | from orm.models import CustomImagePackage | 25 | from orm.models import CustomImagePackage, Package_DependencyManager |
26 | from django.db.models import Q, Max, Sum, Count, When, Case, Value, IntegerField | 26 | from django.db.models import Q, Max, Sum, Count, When, Case, Value, IntegerField |
27 | from django.conf.urls import url | 27 | from django.conf.urls import url |
28 | from django.core.urlresolvers import reverse, resolve | 28 | from django.core.urlresolvers import reverse, resolve |
@@ -695,6 +695,7 @@ class PackagesTable(ToasterTable): | |||
695 | 695 | ||
696 | def setup_queryset(self, *args, **kwargs): | 696 | def setup_queryset(self, *args, **kwargs): |
697 | recipe = Recipe.objects.get(pk=kwargs['recipe_id']) | 697 | recipe = Recipe.objects.get(pk=kwargs['recipe_id']) |
698 | self.static_context_extra['target_name'] = recipe.name | ||
698 | 699 | ||
699 | self.queryset = self.create_package_list(recipe, kwargs['pid']) | 700 | self.queryset = self.create_package_list(recipe, kwargs['pid']) |
700 | self.queryset = self.queryset.order_by('name') | 701 | self.queryset = self.queryset.order_by('name') |
@@ -766,7 +767,19 @@ class SelectPackagesTable(PackagesTable): | |||
766 | 767 | ||
767 | self.queryset = self.queryset.order_by('name') | 768 | self.queryset = self.queryset.order_by('name') |
768 | 769 | ||
770 | # This target is the target used to work out which group of dependences | ||
771 | # to display, if we've built the custom image we use it otherwise we | ||
772 | # can use the based recipe instead | ||
773 | if prj.build_set.filter(target__target=self.cust_recipe.name).count()\ | ||
774 | > 0: | ||
775 | self.static_context_extra['target_name'] = self.cust_recipe.name | ||
776 | else: | ||
777 | self.static_context_extra['target_name'] =\ | ||
778 | Package_DependencyManager.TARGET_LATEST | ||
779 | |||
769 | self.static_context_extra['recipe_id'] = kwargs['custrecipeid'] | 780 | self.static_context_extra['recipe_id'] = kwargs['custrecipeid'] |
781 | |||
782 | |||
770 | self.static_context_extra['current_packages'] = \ | 783 | self.static_context_extra['current_packages'] = \ |
771 | current_packages.values_list('pk', flat=True) | 784 | current_packages.values_list('pk', flat=True) |
772 | 785 | ||