diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-03-05 16:01:37 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-03-05 16:05:07 +0100 |
commit | dbf6ccb5421eb4130fe976083c8a518752b008f5 (patch) | |
tree | 1f19c536c8eba5e3380b0c699a41087181329e18 /bin | |
parent | 877fb9a6336fd8f1a387cb3bb397018b3dee77b3 (diff) | |
download | jenkins.debian.net-dbf6ccb5421eb4130fe976083c8a518752b008f5.tar.xz |
reproducible: html_indexes: write the footnote only if there are packages listed
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_html_indexes.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py index c474c28e..3a5a8ffc 100755 --- a/bin/reproducible_html_indexes.py +++ b/bin/reproducible_html_indexes.py @@ -300,8 +300,9 @@ def build_page_section(page, section, suite, arch): print_critical_message('A query failed: ' + queries[section['query']]) raise html = '' + footnote = True if rows else False if not rows and page != 'scheduled': # there are no package in this set - return html # do not output anything on the page. + return (html, footnote) # do not output anything on the page. html += build_leading_text_section(section, rows, suite, arch) html += '<p>\n' + tab + '<code>\n' for row in rows: @@ -319,7 +320,7 @@ def build_page_section(page, section, suite, arch): if section.get('bottom'): html += section['bottom'] html = (tab*2).join(html.splitlines(True)) - return html + return (html, footnote) def build_page(page, suite=None, arch=None): @@ -329,13 +330,17 @@ def build_page(page, suite=None, arch=None): log.info('Building the ' + page + ' index page for ' + suite + '/' + arch + '...') html = '' + footnote = False for section in pages[page]['body']: if not suite: # global page for lsuite in SUITES: for larch in ARCHES: - html += build_page_section(page, section, lsuite, larch) + html += build_page_section(page, section, lsuite, larch)[0] + footnote = True else: - html += build_page_section(page, section, suite, arch) + html1, footnote1 = build_page_section(page, section, suite, arch) + html += html1 + footnote = True if footnote1 else footnote try: title = pages[page]['title'] except KeyError: @@ -347,7 +352,7 @@ def build_page(page, suite=None, arch=None): destfile = BASE + '/' + suite + '/' + arch + '/index_' + page + '.html' desturl = REPRODUCIBLE_URL + '/' + suite + '/' + arch + '/index_' + \ page + '.html' - write_html_page(title=title, body=html, destfile=destfile, suite=suite, style_note=True) + write_html_page(title=title, body=html, destfile=destfile, suite=suite, style_note=footnote) log.info('"' + title + '" now available at ' + desturl) |