diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/management/commands/signoff_report.py | 2 | ||||
-rw-r--r-- | packages/templatetags/package_extras.py | 58 | ||||
-rw-r--r-- | packages/utils.py | 8 | ||||
-rw-r--r-- | packages/views/__init__.py | 5 | ||||
-rw-r--r-- | packages/views/flag.py | 2 |
5 files changed, 52 insertions, 23 deletions
diff --git a/packages/management/commands/signoff_report.py b/packages/management/commands/signoff_report.py index 3b67f518..f822c8ad 100644 --- a/packages/management/commands/signoff_report.py +++ b/packages/management/commands/signoff_report.py @@ -119,7 +119,7 @@ def generate_report(email, repo_name): 'old_days': old_days, 'leaders': leaders, }) - from_addr = 'Arch Website Notification <nobody@archlinux.org>' + from_addr = 'Parabola Website Notification <nobody@parabolagnulinux.org>' send_mail(subject, t.render(c), from_addr, [email]) # vim: set ts=4 sw=4 et: diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 47b2fecf..d0c163ea 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -74,6 +74,18 @@ def maintainer_link(user): return '' @register.simple_tag +def get_download_link(package): + parts = { + "repo": package.repo.name.lower(), + "arch": package.arch.name, + "pkgfile": package.filename + } + if parts["arch"] == "any": + parts["arch"] = "i686" + linkbase = "//repo.parabolagnulinux.org/%(repo)s/os/%(arch)s/%(pkgfile)s" + return linkbase % parts + +@register.simple_tag def packager_link(user): if user: # TODO don't hardcode @@ -85,40 +97,52 @@ def packager_link(user): ) return '' - -@register.simple_tag -def scm_link(package, operation): - parts = (package.repo.svn_root, operation, package.pkgbase) - linkbase = ( - "http://projects.archlinux.org/svntogit/%s.git/%s/trunk?" - "h=packages/%s") - return linkbase % tuple(urlquote(part) for part in parts) - @register.simple_tag def get_wiki_link(package): - url = "https://wiki.archlinux.org/index.php/Special:Search" + url = "//wiki.parabolagnulinux.org/index.php" data = { + 'title': "Special:Search", 'search': package.pkgname, } return link_encode(url, data) @register.simple_tag +def svn_arch(package): + repo = package.repo.name.lower() + return svn_link(package, "repos/%s-%s" % (repo, package.arch.name)) + +@register.simple_tag +def svn_trunk(package): + return svn_link(package, "trunk") + +@register.simple_tag def bugs_list(package): - url = "https://bugs.archlinux.org/" + url = "//bugs.parabolagnulinux.org/bugs/issue" data = { - 'project': package.repo.bugs_project, - 'string': package.pkgname, + '@action': 'search', + 'title': package.pkgname, } return link_encode(url, data) @register.simple_tag def bug_report(package): - url = "https://bugs.archlinux.org/newtask" + url = "//bugs.parabolagnulinux.org/bugs/issue" data = { - 'project': package.repo.bugs_project, - 'product_category': package.repo.bugs_category, - 'item_summary': '[%s]' % package.pkgname, + '@template': 'item', + 'keyword': 'packages', + 'title': '[%s]' % package.pkgname, } return link_encode(url, data) +@register.simple_tag +def flag_unfree(package): + url = "//bugs.parabolagnulinux.org/bugs/issue" + data = { + '@template': 'item', + 'keyword': 'packages,unfree', + 'nosy': 'dev_list', + 'priority': 'critical', + 'title': '[%s] Please put your reasons here (register first if you haven\'t)' % package.pkgname, + } + return "//bugs.parabolagnulinux.org/bugs/issue?%s" % urlencode(data) # vim: set ts=4 sw=4 et: diff --git a/packages/utils.py b/packages/utils.py index 2a43a08b..ab3c074f 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -109,7 +109,11 @@ SELECT p.id, q.id AND p.arch_id != q.arch_id AND p.id != q.id ) - WHERE p.arch_id IN (%s, %s) + WHERE p.arch_id in (%s, %s) + AND ( + q.arch_id in (%s, %s) + OR q.id IS NULL + ) AND ( q.id IS NULL OR p.pkgver != q.pkgver @@ -118,7 +122,7 @@ SELECT p.id, q.id ) """ cursor = connection.cursor() - cursor.execute(sql, [arch_a.id, arch_b.id]) + cursor.execute(sql, [arch_a.id, arch_b.id, arch_a.id, arch_b.id]) results = cursor.fetchall() # column A will always have a value, column B might be NULL to_fetch = [row[0] for row in results] diff --git a/packages/views/__init__.py b/packages/views/__init__.py index 5be4833e..e66da179 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -233,14 +233,15 @@ def download(request, name, repo, arch): def arch_differences(request): # TODO: we have some hardcoded magic here with respect to the arches. - arch_a = Arch.objects.get(name='i686') - arch_b = Arch.objects.get(name='x86_64') + arch_a = Arch.objects.get(name=request.GET.get('arch_a', 'i686')) + arch_b = Arch.objects.get(name=request.GET.get('arch_b', 'x86_64')) differences = get_differences_info(arch_a, arch_b) multilib_diffs = multilib_differences() context = { 'arch_a': arch_a, 'arch_b': arch_b, 'differences': differences, + 'arches': Arch.objects.filter(agnostic=False), 'multilib_differences': multilib_diffs } return direct_to_template(request, 'packages/differences.html', context) diff --git a/packages/views/flag.py b/packages/views/flag.py index 4ee37f6f..f74a718a 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -97,7 +97,7 @@ def flag(request, name, repo, arch): }) send_mail(subject, tmpl.render(ctx), - 'Arch Website Notification <nobody@archlinux.org>', + 'Parabola Website Notification <nobody@parabolagnulinux.org>', toemail, fail_silently=True) |