[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible: html_indexes: write the footnote only if there are packages listed

Holger Levsen holger at moszumanska.debian.org
Thu Mar 5 15:42:01 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 dbf6ccb5421eb4130fe976083c8a518752b008f5
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Thu Mar 5 16:01:37 2015 +0100

    reproducible: html_indexes: write the footnote only if there are packages listed
---
 TODO                             |  1 -
 bin/reproducible_html_indexes.py | 15 ++++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/TODO b/TODO
index 7e7bf66..e9bdc85 100644
--- a/TODO
+++ b/TODO
@@ -153,7 +153,6 @@ properties:
 
 
 * misc
-** dont show "package symbol explaination footer" if page shows no packages
 ** show package status (briefly) on https://reproducible.debian.net/issues/*html
 ** turn job-cfg/g-i.yaml into .yaml.py
 ** meld bin/reproducible_setup_schroot.sh into bin/schroot-create.sh and alias the former to the latter
diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py
index c474c28..3a5a8ff 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)
 
 

-- 
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