From 72bf6a02f3ee80cba40bb8556e161fd89ad7d886 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 9 May 2011 16:49:20 -0500 Subject: Ensure required by works for arch-agnostic packages We weren't showing required by entries for arch-specific packages that depended on arch-agnostic ones. Make the check a bit less specific for arch-agnostic packages similar to what we do for dependencies. Fixes FS#24184. Signed-off-by: Dan McGee --- main/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'main') diff --git a/main/models.py b/main/models.py index e8f189e7..59dc154b 100644 --- a/main/models.py +++ b/main/models.py @@ -188,9 +188,12 @@ def get_requiredby(self): """ requiredby = PackageDepend.objects.select_related('pkg', 'pkg__arch', 'pkg__repo').filter( - pkg__arch__in=self.applicable_arches(), depname=self.pkgname).order_by( - 'pkg__pkgname', 'pkg__id') + 'pkg__pkgname', 'pkg__arch__name', 'pkg__repo__name') + if not self.arch.agnostic: + # make sure we match architectures if possible + requiredby = requiredby.filter( + pkg__arch__in=self.applicable_arches()) # sort out duplicate packages; this happens if something has a double # versioned dep such as a kernel module requiredby = [list(vals)[0] for k, vals in -- cgit v1.2.3-54-g00ecf