diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/package_extras.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/package_extras.py b/packages/templatetags/package_extras.py index 3ce64748..70456985 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -112,40 +112,59 @@ def packager_link(user): @register.simple_tag 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.parabolagnulinux.org/%s.git/%s/%s/%s") return linkbase % tuple(urlquote(part.encode('utf-8')) for part in parts) @register.simple_tag def get_wiki_link(package): - url = "https://wiki.archlinux.org/index.php/Special:Search" + url = "https://wiki.parabolagnulinux.org/index.php" data = { + 'title': "Special:Search", 'search': package.pkgname, } return link_encode(url, data) - @register.simple_tag 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) @register.simple_tag 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) + +@register.simple_tag +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 6ec39483..fade0855 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 c1f0f492..b6e72d62 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -110,14 +110,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() |