diff options
author | Dan McGee <dan@archlinux.org> | 2011-05-09 16:49:20 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-05-09 16:49:20 -0500 |
commit | 72bf6a02f3ee80cba40bb8556e161fd89ad7d886 (patch) | |
tree | 2f21379f693d5536ae8408a0b4b00437ff41870b | |
parent | bf4d344c18b24f95b58542c2aa0c3df98e627a44 (diff) |
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 <dan@archlinux.org>
-rw-r--r-- | main/models.py | 7 |
1 files changed, 5 insertions, 2 deletions
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 @@ class Package(models.Model): """ 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 |