diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/jinja2.py | 45 | ||||
-rw-r--r-- | packages/utils.py | 6 | ||||
-rw-r--r-- | packages/views/__init__.py | 5 | ||||
-rw-r--r-- | packages/views/flag.py | 4 |
4 files changed, 43 insertions, 17 deletions
diff --git a/packages/templatetags/jinja2.py b/packages/templatetags/jinja2.py index 22f9914b..86bbd03e 100644 --- a/packages/templatetags/jinja2.py +++ b/packages/templatetags/jinja2.py @@ -31,40 +31,59 @@ def pgp_key_link(key_id, link_text=None): @library.global_function def scm_link(package, operation): - parts = (package.repo.svn_root, operation, package.pkgbase) + parts = ("abslibre", operation, package.repo.name.lower(), package.pkgbase) linkbase = ( - "https://projects.archlinux.org/svntogit/%s.git/%s/trunk?" - "h=packages/%s") + "https://projects.parabola.nu/%s.git/%s/%s/%s") return linkbase % tuple(urlquote(part.encode('utf-8')) for part in parts) @library.global_function def wiki_link(package): - url = "https://wiki.archlinux.org/index.php/Special:Search" + url = "https://wiki.parabola.nu/index.php" data = { + 'title': "Special:Search", 'search': package.pkgname, } return link_encode(url, data) - @library.global_function def bugs_list(package): - url = "https://bugs.archlinux.org/" + url = "https://labs.parabola.nu/search/index/" + if package.arch.name == 'mips64el': + url = url + "mips64el" + else: + url = url + "issue-tracker" data = { - 'project': package.repo.bugs_project, - 'cat[]': package.repo.bugs_category, - 'string': package.pkgname, + 'titles_only': '1', + 'issues': '1', + 'q': package.pkgname, } return link_encode(url, data) @library.global_function def bug_report(package): - url = "https://bugs.archlinux.org/newtask" + url = "https://labs.parabola.nu/projects/" + if package.arch.name == 'mips64el': + url = url + "mips64el/issues/new" + else: + url = url + "issue-tracker/issues/new" + data = { + 'issue[subject]': '[%s] PLEASE ENTER SUMMARY' % package.pkgname, + } + return link_encode(url, data) + +@library.global_function +def flag_unfree(package): + url = "https://labs.parabola.nu/projects/" + if package.arch.name == 'mips64el': + url = url + "mips64el/issues/new" + else: + url = url + "issue-tracker/issues/new" data = { - 'project': package.repo.bugs_project, - 'product_category': package.repo.bugs_category, - 'item_summary': '[%s] PLEASE ENTER SUMMARY' % package.pkgname, + 'issue[priority_id]': '1', # "freedom issue" + 'issue[watcher_user_ids][]': '62', # "dev-list" + 'issue[subject]': '[%s] Please put your reasons here (register first if you haven\'t)' % package.pkgname, } return link_encode(url, data) diff --git a/packages/utils.py b/packages/utils.py index 0f47f170..c38aa840 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -137,6 +137,10 @@ SELECT p.id, q.id ) 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 OR p.pkgrel != q.pkgrel @@ -144,7 +148,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 6b44206a..f3d64548 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -107,14 +107,15 @@ def update(request): 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 render(request, 'packages/differences.html', context) diff --git a/packages/views/flag.py b/packages/views/flag.py index 5680683a..c6936ac4 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -5,6 +5,7 @@ from django.conf import settings from django.contrib.auth.decorators import permission_required from django.core.mail import EmailMessage from django.db import transaction +from django.db.models import Q from django.shortcuts import get_object_or_404, redirect, render from django.template import loader, Context from django.utils.timezone import now @@ -58,7 +59,8 @@ def flag(request, name, repo, arch): pkgs = Package.objects.normal().filter( pkgbase=pkg.pkgbase, flag_date__isnull=True, repo__testing=pkg.repo.testing, - repo__staging=pkg.repo.staging).order_by( + repo__staging=pkg.repo.staging).filter( + Q(arch__name='mips64el') | Q(repo__name='Libre') | Q(repo__name='Pcr')).order_by( 'pkgname', 'repo__name', 'arch__name') authenticated = request.user.is_authenticated() |