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-13 22:04:30 +0100 |
commit | 31e7c26cc31a7c8c78c1464fa01581683bfd2965 (patch) | |
tree | 33fa4c6a19741b049fdd2b873dcbe5f881992e6d /lib/toaster/toastergui/tables.py | |
parent | 566b4fbe9cfe4c6c0605c4f6444083ee4cf8b958 (diff) | |
download | bitbake-31e7c26cc31a7c8c78c1464fa01581683bfd2965.tar.gz |
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]
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Diffstat (limited to 'lib/toaster/toastergui/tables.py')
-rw-r--r-- | lib/toaster/toastergui/tables.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/toaster/toastergui/tables.py b/lib/toaster/toastergui/tables.py index 902f62f70..79673f5da 100644 --- a/lib/toaster/toastergui/tables.py +++ b/lib/toaster/toastergui/tables.py @@ -22,7 +22,7 @@ from toastergui.widgets import ToasterTable from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task -from orm.models import CustomImagePackage +from orm.models import CustomImagePackage, Package_DependencyManager from django.db.models import Q, Max, Sum, Count, When, Case, Value, IntegerField from django.conf.urls import url from django.core.urlresolvers import reverse, resolve @@ -695,6 +695,7 @@ class PackagesTable(ToasterTable): def setup_queryset(self, *args, **kwargs): recipe = Recipe.objects.get(pk=kwargs['recipe_id']) + self.static_context_extra['target_name'] = recipe.name self.queryset = self.create_package_list(recipe, kwargs['pid']) self.queryset = self.queryset.order_by('name') @@ -766,7 +767,19 @@ class SelectPackagesTable(PackagesTable): self.queryset = self.queryset.order_by('name') + # This target is the target used to work out which group of dependences + # to display, if we've built the custom image we use it otherwise we + # can use the based recipe instead + if prj.build_set.filter(target__target=self.cust_recipe.name).count()\ + > 0: + self.static_context_extra['target_name'] = self.cust_recipe.name + else: + self.static_context_extra['target_name'] =\ + Package_DependencyManager.TARGET_LATEST + self.static_context_extra['recipe_id'] = kwargs['custrecipeid'] + + self.static_context_extra['current_packages'] = \ current_packages.values_list('pk', flat=True) |