From e0bf193c555c2a07be2f37defb1270e9a1acb39c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 8 Sep 2010 10:42:44 -0500 Subject: Fix download links to work with package pools With package pooling we don't put things in the '/any/' folder anymore under each repository; they only show up in the actual architectures. Use a 'real' architecture as part of the download link to rectify this. Fixes FS#20779. Signed-off-by: Dan McGee --- packages/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'packages/views.py') diff --git a/packages/views.py b/packages/views.py index 6f05cb8f..784d2540 100644 --- a/packages/views.py +++ b/packages/views.py @@ -349,9 +349,13 @@ def download(request, name='', repo='', arch=''): mirrorurl = MirrorUrl.objects.filter(mirror__country='Any', mirror__public=True, mirror__active=True, protocol__protocol__iexact='HTTP')[0] + arch = pkg.arch.name + if arch == 'any': + # grab the first non-any arch to fake the download path + arch = Arch.objects.exclude(name='any')[0].name details = { 'host': mirrorurl.url, - 'arch': pkg.arch.name, + 'arch': arch, 'repo': pkg.repo.name.lower(), 'file': pkg.filename, } -- cgit v1.2.3-54-g00ecf