summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/management/commands/signoff_report.py2
-rw-r--r--packages/templatetags/package_extras.py58
-rw-r--r--packages/utils.py8
-rw-r--r--packages/views/__init__.py5
-rw-r--r--packages/views/flag.py2
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 3eb7578d..a8a8bd0f 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -73,6 +73,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
@@ -84,40 +96,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 f8e1f2a1..82d47bc7 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -106,7 +106,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
@@ -115,7 +119,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 13ad0c71..7a8dabd5 100644
--- a/packages/views/__init__.py
+++ b/packages/views/__init__.py
@@ -230,13 +230,14 @@ 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)
context = {
'arch_a': arch_a,
'arch_b': arch_b,
'differences': differences,
+ 'arches': Arch.objects.filter(agnostic=False)
}
return direct_to_template(request, 'packages/differences.html', context)
diff --git a/packages/views/flag.py b/packages/views/flag.py
index 7e9d87c7..5db2ea69 100644
--- a/packages/views/flag.py
+++ b/packages/views/flag.py
@@ -71,7 +71,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)