summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/templatetags/jinja2.py45
-rw-r--r--packages/utils.py6
-rw-r--r--packages/views/__init__.py7
-rw-r--r--packages/views/flag.py4
4 files changed, 46 insertions, 16 deletions
diff --git a/packages/templatetags/jinja2.py b/packages/templatetags/jinja2.py
index 88b59a96..cc2f8e91 100644
--- a/packages/templatetags/jinja2.py
+++ b/packages/templatetags/jinja2.py
@@ -31,17 +31,17 @@ 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)
@@ -49,22 +49,43 @@ def wiki_link(package):
@library.global_function
def bugs_list(package):
- url = "https://bugs.archlinux.org/"
+ if package.arch.name == 'mips64el':
+ project = "mips64el"
+ else:
+ project = "issue-tracker"
+ url = "https://labs.parabola.nu/projects/%s/search" % project
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 = {
- 'project': package.repo.bugs_project,
- 'product_category': package.repo.bugs_category,
- 'item_summary': '[%s] PLEASE ENTER SUMMARY' % package.pkgname,
+ '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 = {
+ 'issue[tracker_id]': '4', # "freedom issue"
+ '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 7941a265..84ca37f2 100644
--- a/packages/views/__init__.py
+++ b/packages/views/__init__.py
@@ -107,14 +107,17 @@ 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'))
+ arch_c = Arch.objects.get(name=request.GET.get('arch_c', 'armv7h'))
differences = get_differences_info(arch_a, arch_b)
multilib_diffs = multilib_differences()
context = {
'arch_a': arch_a,
'arch_b': arch_b,
+ 'arch_c': arch_c,
'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()