From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CCBA5E0092C; Thu, 31 Mar 2016 11:56:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.146.13 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 6D0D7E006CA for ; Thu, 31 Mar 2016 11:56:35 -0700 (PDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id u2VIuYhd024256 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 31 Mar 2016 11:56:34 -0700 (PDT) Received: from ord-dlerner-d8.corp.ad.wrs.com (172.25.44.98) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.248.2; Thu, 31 Mar 2016 11:56:33 -0700 From: Dave Lerner To: , , Date: Thu, 31 Mar 2016 13:56:26 -0500 Message-ID: <1459450586-1663-2-git-send-email-dave.lerner@windriver.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459450586-1663-1-git-send-email-dave.lerner@windriver.com> References: <1459450586-1663-1-git-send-email-dave.lerner@windriver.com> MIME-Version: 1.0 Subject: [review-request v3] [Patch 1/1] toaster: add rev dep column to image detail pages X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2016 18:56:37 -0000 Content-Type: text/plain Add a column to the custom image pages that shows the reverse dependencies in a format matching the dependencies column: - either blank or a button showing the count of reverse dependencies, - when the button is clicked, a popover appears showing the list of reverse dependencies, with each package's size, and the total size of all of the reverse dependencies. The implementation adds a packages table method to retreive the reverse dependency total size, and adds a separate 'popover' html template. Both of these changes follow the pattern for the dependencies column. [YOCTO #9163] Signed-off-by: Dave Lerner --- bitbake/lib/toaster/orm/models.py | 7 +++++++ bitbake/lib/toaster/toastergui/tables.py | 6 ++++++ .../templates/snippets/pkg_revdependencies_popover.html | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 6ae6316..cfab7b7 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -813,6 +813,13 @@ class Package_DependencyManager(models.Manager): """ return self.all().aggregate(Sum('depends_on__size')) + def get_total_revdeps_size(self): + """ Returns the total file size of all the packages that depend on + this package. + """ + return self.all().aggregate(Sum('package_id__size')) + + def all_depends(self): """ Returns just the depends packages and not any other dep_type """ 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 67a6592..c677ec5 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py @@ -725,6 +725,12 @@ class PackagesTable(ToasterTable): static_data_template='\ {% include "snippets/pkg_dependencies_popover.html" %}') + self.add_column(title="Reverse dependencies", + static_data_name="reverse_dependencies", + static_data_template='\ + {% include "snippets/pkg_revdependencies_popover.html" %}', + hidden=True) + self.add_column(title="Recipe", field_name="recipe__name", 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 0000000..04fd2d3 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html @@ -0,0 +1,15 @@ +{# Popover that displays the reverse dependencies and sizes of a package 'data' used in the Packages table #} +{% with data.package_dependencies_target.all_depends.count as dep_count %} +{% load projecttags %} +{% if dep_count %} + + {{dep_count}} + +{% endif %} +{% endwith %} + -- 2.7.4