summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates
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/templates
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/templates')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html44
-rw-r--r--bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html46
2 files changed, 69 insertions, 21 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
index 0a24e9217e..5be409ca44 100644
--- a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
+++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
@@ -1,14 +1,38 @@
1{# Popover that displays the dependences and sizes of a package 'data' used in the Packages table #} 1{# Popover that displays the dependences and sizes of a package 'data' used in the Packages table #}
2{% with data.package_dependencies_source.all_depends.count as dep_count %}
3{% load projecttags %} 2{% load projecttags %}
4{% if dep_count %} 3
5 <a data-content="<ul class='list-unstyled'> 4{% with package_deps=data.package_dependencies_source|for_target:extra.target_name %}
6 {% for dep in data.package_dependencies_source.all_depends %} 5{% with count_package=package_deps.packages|length %}
7 <li>{{dep.depends_on.name}} {% if dep.depends_on.size > 0 %}({{dep.depends_on.size|filtered_filesizeformat}}){% endif %}</li> 6
8 {% endfor %} 7{% if count_package > 0 %}
9 </ul>" class="btn btn-default" title=" 8 <a data-content='<ul class="unstyled">
10 <strong>{{data.name}}</strong> dependencies - <strong>{{data.package_dependencies_source.get_total_source_deps_size.depends_on__size__sum|filtered_filesizeformat}}</strong>"> 9 {% for dep in package_deps.packages %}
11 {{dep_count}} 10 <li>
12</a> 11 {% if extra.add_links %}
12 <a href="{% url 'package_included_detail' extra.build.pk extra.target_id dep.depends_on.pk %}">
13 {{dep.depends_on.name}}</a>
14 {% else %}
15 {{dep.depends_on.name}}
16 {% endif %}
17 {% if dep.depends_on.size > 0 %}
18 ({{dep.depends_on.size|filtered_filesizeformat}})
19 {% endif %}
20 </li>
21 {% endfor %}
22 </ul>' class="btn btn-default" title='
23 <strong>
24 {% if extra.add_links %}
25 <a href="{% url 'package_included_dependencies' extra.build.pk extra.target_id data.pk %}">
26 {{data.name}}</a>
27 {% else %}
28 {{data.name}}
29 {% endif %}
30 </strong>
31 dependencies -
32 <strong>{{package_deps.size|filtered_filesizeformat}}</strong>'>
33 {{count_package}}
34 </a>
13{% endif %} 35{% endif %}
36
37{% endwith %}
14{% endwith %} 38{% endwith %}
diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
index d470712121..65c2b29d0b 100644
--- a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
+++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
@@ -1,14 +1,38 @@
1{# Popover that displays the reverse dependencies and sizes of a package 'data' used in the Packages table #} 1{# Popover that displays the reverse dependences and sizes of a package 'data' used in the Packages table #}
2{% with data.package_dependencies_target.all_depends.count as dep_count %}
3{% load projecttags %} 2{% load projecttags %}
4{% if dep_count %} 3
5 <a data-content="<ul class='list-unstyled'> 4{% with package_deps=data.package_dependencies_target|for_target:extra.target_name %}
6 {% for dep in data.package_dependencies_target.all_depends|dictsort:'package.name' %} 5{% with count_package=package_deps.packages|length %}
7 <li>{{dep.package.name}} {% if dep.package.size > 0 %}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li> 6
8 {% endfor %} 7{% if count_package > 0 %}
9 </ul>" class="btn btn-default" title=" 8 <a data-content='<ul class="unstyled">
10 <strong>{{data.name}}</strong> reverse dependencies - <strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|filtered_filesizeformat}}</strong>"> 9 {% for dep in package_deps.packages|dictsort:"package.name" %}
11 {{dep_count}} 10 <li>
12</a> 11 {% if extra.add_links %}
12 <a href="{% url 'package_included_detail' extra.build.pk extra.target_id dep.package.pk %}">
13 {{dep.package.name}}</a>
14 {% else %}
15 {{dep.package.name}}
16 {% endif %}
17 {% if dep.package.size > 0 %}
18 ({{dep.package.size|filtered_filesizeformat}})
19 {% endif %}
20 </li>
21 {% endfor %}
22 </ul>' class="btn btn-default" title='
23 <strong>
24 {% if extra.add_links %}
25 <a href="{% url 'package_included_reverse_dependencies' extra.build.pk extra.target_id data.pk %}">
26 {{data.name}}</a>
27 {% else %}
28 {{data.name}}
29 {% endif %}
30 </strong>
31 dependencies -
32 <strong>{{package_deps.size|filtered_filesizeformat}}</strong>'>
33 {{count_package}}
34 </a>
13{% endif %} 35{% endif %}
36
37{% endwith %}
14{% endwith %} 38{% endwith %}