From f5a6ff341efc9edfabe8e565e88209af582e902d Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 10 Mar 2015 01:04:23 +0100 Subject: reproducible: merge suite specific schedule pages into single global one --- bin/reproducible_html_indexes.py | 45 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'bin/reproducible_html_indexes.py') diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py index d68aea9d..9230fc08 100755 --- a/bin/reproducible_html_indexes.py +++ b/bin/reproducible_html_indexes.py @@ -44,7 +44,7 @@ section must have at least a `query` defining what to file in. queries = { 'count_total': 'SELECT COUNT(*) FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}"', - 'scheduled': 'SELECT s.name FROM schedule AS p JOIN sources AS s ON p.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" ORDER BY p.date_scheduled', + 'scheduled': 'SELECT (select count(*) from schedule as sch_b where sch.id >= sch_b.id), s.suite, s.architecture, s.name FROM schedule AS sch JOIN sources AS s ON sch.package_id=s.id WHERE sch.date_build_started = "" ORDER BY sch.date_scheduled', 'reproducible_all': 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" AND r.status="reproducible" ORDER BY r.build_date DESC', 'reproducible_last24h': 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" AND r.status="reproducible" AND r.build_date > datetime("now", "-24 hours") ORDER BY r.build_date DESC', 'reproducible_last48h': 'SELECT s.name FROM results AS r JOIN sources AS s ON r.package_id=s.id WHERE s.suite="{suite}" AND s.architecture="{arch}" AND r.status="reproducible" AND r.build_date > datetime("now", "-48 hours") ORDER BY r.build_date DESC', @@ -126,16 +126,6 @@ pages = { } ] }, - 'scheduled': { - 'title': 'Packages in {suite}/{arch} currently scheduled for testing for build reproducibility', - 'body': [ - { - 'query': 'scheduled', - 'text': Template('$tot packages are currently scheduled for testing in $suite/$arch:'), - 'bottom': 'A full scheduling overview is also available.' - } - ] - }, 'all_abc': { 'title': 'Overview of reproducible builds in {suite}/{arch} of all tested packages (sorted alphabetically)', 'body': [ @@ -249,7 +239,7 @@ global_pages = { 'body': [ { 'query': 'scheduled', - 'text': Template('$tot packages are currently scheduled for testing in $suite/$arch:') + 'text': Template('$tot packages are currently scheduled for testing:') } ] } @@ -304,19 +294,34 @@ def build_page_section(page, section, suite, arch): if not rows and page != 'scheduled': # there are no package in this set return (html, footnote) # do not output anything on the page. html += build_leading_text_section(section, rows, suite, arch) - html += '

\n' + tab + '\n' + if page == 'scheduled': + html += '

\n' + tab + '\n' + else: + html += '

\n' + tab + '\n' for row in rows: - pkg = row[0] - url = RB_PKG_URI + '/' + suite + '/' + arch + '/' + pkg + '.html' - html += tab*2 + '' + pkg + '' - html += get_trailing_icon(pkg, bugs) + '\n' - html += tab + '\n' - html += '

' + html += get_trailing_icon(pkg, bugs) + if page == 'scheduled': + html += '
' + html += '\n' + if page == 'scheduled': + html += '
#suitearchpackage

\n' + else: + html += tab + '\n' + html += '

' if section.get('bottom'): html += section['bottom'] html = (tab*2).join(html.splitlines(True)) @@ -344,6 +349,8 @@ def build_page(page, suite=None, arch=None): for lsuite in SUITES: for larch in ARCHES: html += build_page_section(page, section, lsuite, larch)[0] + if page == 'scheduled': + break footnote = True else: html1, footnote1 = build_page_section(page, section, suite, arch) -- cgit v1.2.3-54-g00ecf