From fe58d721a9dccaa1b4778ae9ef0abb118bb90ae1 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Thu, 5 Mar 2015 13:21:17 +0100 Subject: reproducible: add suite links in the rb_pkg pages --- bin/reproducible_html_packages.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'bin') diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index f4e1dba1..197e96bc 100755 --- a/bin/reproducible_html_packages.py +++ b/bin/reproducible_html_packages.py @@ -29,6 +29,7 @@ $links -->rules} +${suites_links} ${bugs_links} @@ -127,6 +128,27 @@ def gen_extra_links(package, version, suite, arch): ' did not produce any buildlog! Check ' + rbuild) return (links, default_view) + +def gen_suites_links(package, suite): + html = '' + query = 'SELECT s.suite, s.architecture ' + \ + 'FROM sources AS s JOIN results AS r ON r.package_id=s.id ' + \ + 'WHERE s.name="{pkg}"'.format(pkg=package) + results = query_db(query) + if len(results) < 1: + print_critical_message('This query produces 0 results:\n' + query) + raise ValueError + if len(results) == 1: + return html + for i in results: + # i[0]: suite, i[1]: arch + if i[0] == suite: + continue + html += '' + i[0] + '\n' + return html + + def gen_bugs_links(package, bugs): html = '' if package in bugs: @@ -170,6 +192,7 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F links, default_view = gen_extra_links(pkg, version, suite, arch) bugs_links = gen_bugs_links(pkg, bugs) + suites_links = gen_suites_links(pkg, suite) status, icon = join_status_icon(status, pkg, version) html = html_package_page.substitute(package=pkg, @@ -178,6 +201,7 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F build_time=build_date, icon=icon, links=links, + suites_links=suites_links, bugs_links=bugs_links, default_view=default_view) destfile = RB_PKG_PATH + '/' + suite + '/' + arch + '/' + pkg + '.html' -- cgit v1.2.3-70-g09d2