summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-05 18:21:59 +0200
committerDan McGee <dan@archlinux.org>2012-08-05 18:21:59 +0200
commit8ca64af397718f7dda0080467d202c6a70a33c8c (patch)
tree8baf99383cff99e5fa191c26132cbb79a56f7433 /main
parenta87864f6d05250c9b07b8b9eaecae669505c7f38 (diff)
downloadarchweb-8ca64af397718f7dda0080467d202c6a70a33c8c.tar.gz
archweb-8ca64af397718f7dda0080467d202c6a70a33c8c.tar.xz
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>
Diffstat (limited to 'main')
-rw-r--r--main/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/main/models.py b/main/models.py
index f4ced35..7d8ea75 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):