diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-08 11:12:43 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-08 11:12:43 -0500 |
commit | 04da5f03b254a6000c92eb4e32bdfaa88724f4a4 (patch) | |
tree | ce7dd0ff708ce92e37b52a2ff4f6f9cad35bed7a /packages | |
parent | 5c78ad746942cafa03ed4834eefac98832021558 (diff) |
Use arch.agnostic flag everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/views.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/views.py b/packages/views.py index 784d2540..4cc4cc2f 100644 --- a/packages/views.py +++ b/packages/views.py @@ -87,8 +87,10 @@ def groups(request): def group_details(request, arch, name): arch = get_object_or_404(Arch, name=arch) - pkgs = Package.objects.filter(packagegroup__name=name) - pkgs = pkgs.filter(Q(arch__name=arch) | Q(arch__name='any')) + arches = [ arch ] + arches.extend(Arch.objects.filter(agnostic=True)) + pkgs = Package.objects.filter(packagegroup__name=name, + arch__in=arches) pkgs = pkgs.order_by('pkgname') if len(pkgs) == 0: raise Http404 @@ -350,9 +352,9 @@ def download(request, name='', repo='', arch=''): mirror__public=True, mirror__active=True, protocol__protocol__iexact='HTTP')[0] arch = pkg.arch.name - if arch == 'any': + if pkg.arch.agnostic: # grab the first non-any arch to fake the download path - arch = Arch.objects.exclude(name='any')[0].name + arch = Arch.objects.exclude(agnostic=True)[0].name details = { 'host': mirrorurl.url, 'arch': arch, |