From dd764003ea2cb9449f838146183f17873a902e48 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 26 May 2016 16:12:27 +0100 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/buildtables.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/buildtables.py') diff --git a/bitbake/lib/toaster/toastergui/buildtables.py b/bitbake/lib/toaster/toastergui/buildtables.py index 17de369305..e237e4ecb6 100644 --- a/bitbake/lib/toaster/toastergui/buildtables.py +++ b/bitbake/lib/toaster/toastergui/buildtables.py @@ -47,6 +47,7 @@ class BuiltPackagesTableBase(tables.PackagesTable): def setup_queryset(self, *args, **kwargs): build = Build.objects.get(pk=kwargs['build_id']) self.static_context_extra['build'] = build + self.static_context_extra['target_name'] = None self.queryset = build.package_set.all().exclude(recipe=None) self.queryset = self.queryset.order_by(self.default_orderby) @@ -187,7 +188,15 @@ class InstalledPackagesTable(BuildTablesMixin, BuiltPackagesTableBase): self.static_context_extra['build'] = build target = Target.objects.get(pk=kwargs['target_id']) + # We send these separately because in the case of image details table + # we don't have a target just the recipe name as the target + self.static_context_extra['target_name'] = target.target + self.static_context_extra['target_id'] = target.pk + + self.static_context_extra['add_links'] = True + self.queryset = self.make_package_list(target) + self.queryset = self.queryset.order_by(self.default_orderby) def setup_columns(self, *args, **kwargs): super(InstalledPackagesTable, self).setup_columns(**kwargs) @@ -195,11 +204,13 @@ class InstalledPackagesTable(BuildTablesMixin, BuiltPackagesTableBase): static_data_name="installed_size", static_data_template="{% load projecttags %}" "{{data.size|filtered_filesizeformat}}", - orderable=True) + orderable=True, + hidden=True) # Add the template to show installed name for installed packages install_name_tmpl =\ - ('{{data.name}} ' + ('{{data.name}}' '{% if data.installed_name and data.installed_name !=' ' data.name %}' ' as {{data.installed_name}}' -- cgit v1.2.3-54-g00ecf