summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-05 11:21:59 -0500
committerDan McGee <dan@archlinux.org>2012-08-05 11:21:59 -0500
commit8ca64af397718f7dda0080467d202c6a70a33c8c (patch)
tree8baf99383cff99e5fa191c26132cbb79a56f7433
parenta87864f6d05250c9b07b8b9eaecae669505c7f38 (diff)
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 <dan@archlinux.org>
-rw-r--r--main/models.py10
1 files changed, 9 insertions, 1 deletions
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 @@ class Package(models.Model):
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):