summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/buildtables.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-05-26 16:12:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-15 08:35:04 +0100
commitdd764003ea2cb9449f838146183f17873a902e48 (patch)
treea0824c31ae2049a1784d91a8e1d7fe8735e3c6b7 /bitbake/lib/toaster/toastergui/buildtables.py
parent89433a35e6e21a978cef3e41e24d87024ed9a6ed (diff)
downloadpoky-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/buildtables.py')
-rw-r--r--bitbake/lib/toaster/toastergui/buildtables.py15
1 files changed, 13 insertions, 2 deletions
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):
47 def setup_queryset(self, *args, **kwargs): 47 def setup_queryset(self, *args, **kwargs):
48 build = Build.objects.get(pk=kwargs['build_id']) 48 build = Build.objects.get(pk=kwargs['build_id'])
49 self.static_context_extra['build'] = build 49 self.static_context_extra['build'] = build
50 self.static_context_extra['target_name'] = None
50 self.queryset = build.package_set.all().exclude(recipe=None) 51 self.queryset = build.package_set.all().exclude(recipe=None)
51 self.queryset = self.queryset.order_by(self.default_orderby) 52 self.queryset = self.queryset.order_by(self.default_orderby)
52 53
@@ -187,7 +188,15 @@ class InstalledPackagesTable(BuildTablesMixin, BuiltPackagesTableBase):
187 self.static_context_extra['build'] = build 188 self.static_context_extra['build'] = build
188 189
189 target = Target.objects.get(pk=kwargs['target_id']) 190 target = Target.objects.get(pk=kwargs['target_id'])
191 # We send these separately because in the case of image details table
192 # we don't have a target just the recipe name as the target
193 self.static_context_extra['target_name'] = target.target
194 self.static_context_extra['target_id'] = target.pk
195
196 self.static_context_extra['add_links'] = True
197
190 self.queryset = self.make_package_list(target) 198 self.queryset = self.make_package_list(target)
199 self.queryset = self.queryset.order_by(self.default_orderby)
191 200
192 def setup_columns(self, *args, **kwargs): 201 def setup_columns(self, *args, **kwargs):
193 super(InstalledPackagesTable, self).setup_columns(**kwargs) 202 super(InstalledPackagesTable, self).setup_columns(**kwargs)
@@ -195,11 +204,13 @@ class InstalledPackagesTable(BuildTablesMixin, BuiltPackagesTableBase):
195 static_data_name="installed_size", 204 static_data_name="installed_size",
196 static_data_template="{% load projecttags %}" 205 static_data_template="{% load projecttags %}"
197 "{{data.size|filtered_filesizeformat}}", 206 "{{data.size|filtered_filesizeformat}}",
198 orderable=True) 207 orderable=True,
208 hidden=True)
199 209
200 # Add the template to show installed name for installed packages 210 # Add the template to show installed name for installed packages
201 install_name_tmpl =\ 211 install_name_tmpl =\
202 ('{{data.name}} ' 212 ('<a href="{% url "package_included_detail" extra.build.pk'
213 ' extra.target_id data.pk %}">{{data.name}}</a>'
203 '{% if data.installed_name and data.installed_name !=' 214 '{% if data.installed_name and data.installed_name !='
204 ' data.name %}' 215 ' data.name %}'
205 '<span class="muted"> as {{data.installed_name}}</span>' 216 '<span class="muted"> as {{data.installed_name}}</span>'