[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible: html_packages: generate the status icon/link instead of templating them, to avoid linking untested packages
Holger Levsen
holger at moszumanska.debian.org
Sat Mar 7 10:19:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch master
in repository jenkins.debian.net.
commit 8245ad59be91a47422b84e59cb4d40d14536c255
Author: Mattia Rizzolo <mattia at mapreri.org>
Date: Sat Mar 7 11:16:37 2015 +0100
reproducible: html_packages: generate the status icon/link instead of templating them, to avoid linking untested packages
---
bin/reproducible_html_packages.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index c3671a4..d09468c 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -16,9 +16,7 @@ html_package_page = Template((tab*2).join(("""
<tr>
<td>
<span style="font-size:1.2em;">$package</span> $version
- <a href="/index_$status.html" target="_parent" title="$status">
- <img src="/static/$icon" alt="$status" />
- </a>
+$status
<span style="font-size:0.9em;">$build_time:</span>
$links
<a href="https://tracker.debian.org/$package" target="main">PTS</a>
@@ -89,6 +87,18 @@ def check_package_status(package, suite, nocheck=False):
build_date = '<span style="color:red;font-weight:bold;">UNTESTED</span>'
return (status, version, build_date)
+
+def gen_status_link_icon(status, icon):
+ html = ''
+ if status != 'untested':
+ html += tab*6 + '<a href="/index_{status}.html" target="_parent" ' + \
+ 'title="{status}">\n'
+ html += tab*9 + '<img src="/static/{icon}" alt="{status}" />\n'
+ if status != 'untested':
+ html += tab*8 + '</a>\n'
+ return html.format(status=status, icon=icon)
+
+
def gen_extra_links(package, version, suite, arch):
eversion = strip_epoch(version)
notes = NOTES_PATH + '/' + package + '_note.html'
@@ -186,12 +196,12 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F
links, default_view = gen_extra_links(pkg, version, suite, arch)
suites_links = gen_suites_links(pkg, suite)
status, icon = join_status_icon(status, pkg, version)
+ status = gen_status_link_icon(status, icon)
html = html_package_page.substitute(package=pkg,
status=status,
version=version,
build_time=build_date,
- icon=icon,
links=links,
suites_links=suites_links,
default_view=default_view)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git
More information about the Qa-jenkins-scm
mailing list