diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 7 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 6 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html | 14 |
3 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 2a01184a73..68c3072991 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -822,6 +822,13 @@ class Package_DependencyManager(models.Manager): | |||
822 | """ | 822 | """ |
823 | return self.all().aggregate(Sum('depends_on__size')) | 823 | return self.all().aggregate(Sum('depends_on__size')) |
824 | 824 | ||
825 | def get_total_revdeps_size(self): | ||
826 | """ Returns the total file size of all the packages that depend on | ||
827 | this package. | ||
828 | """ | ||
829 | return self.all().aggregate(Sum('package_id__size')) | ||
830 | |||
831 | |||
825 | def all_depends(self): | 832 | def all_depends(self): |
826 | """ Returns just the depends packages and not any other dep_type """ | 833 | """ Returns just the depends packages and not any other dep_type """ |
827 | return self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) | | 834 | return self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) | |
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index 385d65895d..2cc2f4eb7b 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
@@ -725,6 +725,12 @@ class PackagesTable(ToasterTable): | |||
725 | static_data_template='\ | 725 | static_data_template='\ |
726 | {% include "snippets/pkg_dependencies_popover.html" %}') | 726 | {% include "snippets/pkg_dependencies_popover.html" %}') |
727 | 727 | ||
728 | self.add_column(title="Reverse dependencies", | ||
729 | static_data_name="reverse_dependencies", | ||
730 | static_data_template='\ | ||
731 | {% include "snippets/pkg_revdependencies_popover.html" %}', | ||
732 | hidden=True) | ||
733 | |||
728 | self.add_column(title="Recipe", | 734 | self.add_column(title="Recipe", |
729 | field_name="recipe__name", | 735 | field_name="recipe__name", |
730 | orderable=True, | 736 | orderable=True, |
diff --git a/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html new file mode 100644 index 0000000000..453a9d0137 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html | |||
@@ -0,0 +1,14 @@ | |||
1 | {# Popover that displays the reverse dependencies 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 %} | ||
4 | {% if dep_count %} | ||
5 | <a data-content="<ul class='unstyled'> | ||
6 | {% for dep in data.package_dependencies_target.all_depends|dictsort:'package.name' %} | ||
7 | <li>{{dep.package.name}} {% if dep.package.size > 0 %}({{dep.package.size|filtered_filesizeformat}}){% endif %}</li> | ||
8 | {% endfor %} | ||
9 | </ul>" title="" class="btn" data-original-title=" | ||
10 | <strong>{{data.name}}</strong> reverse dependencies - <strong>{{data.package_dependencies_target.get_total_revdeps_size.package_id__size__sum|filtered_filesizeformat}}</strong>"> | ||
11 | {{dep_count}} | ||
12 | </a> | ||
13 | {% endif %} | ||
14 | {% endwith %} | ||