From 8ca64af397718f7dda0080467d202c6a70a33c8c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 5 Aug 2012 11:21:59 -0500 Subject: Smarter handling of multilib packages in "Versions Elsewhere" We can do some manipulation of the pkgname to ensure multilib packages show up here, as well as showing the non-multilib versions in the list when viewing the multilib packages. Signed-off-by: Dan McGee --- main/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/models.py b/main/models.py index f4ced350..7d8ea755 100644 --- a/main/models.py +++ b/main/models.py @@ -336,8 +336,16 @@ def in_staging(self): def elsewhere(self): '''attempt to locate this package anywhere else, regardless of architecture or repository. Excludes this package from the list.''' + names = [self.pkgname] + if self.pkgname.startswith('lib32-'): + names.append(self.pkgname[6:]) + elif self.pkgname.endswith('-multilib'): + names.append(self.pkgname[:-9]) + else: + names.append('lib32-' + self.pkgname) + names.append(self.pkgname + '-multilib') return Package.objects.normal().filter( - pkgname=self.pkgname).exclude(id=self.id).order_by( + pkgname__in=names).exclude(id=self.id).order_by( 'arch__name', 'repo__name') class PackageFile(models.Model): -- cgit v1.2.3-54-g00ecf