summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-02-27 02:56:30 +0100
committerMattia Rizzolo <mattia@mapreri.org>2015-02-27 02:56:30 +0100
commit4d3f591f10c9227279bf46f03819f983fed0f410 (patch)
tree24f2301c1d51fe374a71351b7e390bbde279442b /bin
parent77877a39ef752adb77790b4c777c73bc6496601d (diff)
downloadjenkins.debian.net-4d3f591f10c9227279bf46f03819f983fed0f410.tar.xz
reproducible: notes: check wheter the package has been tested before rebuilding the page in purge_old_notes(). This fix a issue with packages removed from the archive
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_html_notes.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 1f047130..56acd3ff 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -260,6 +260,7 @@ def gen_html_issue(issue):
def purge_old_notes(notes):
removed_pages = []
+ to_rebuild = []
presents = sorted(os.listdir(NOTES_PATH))
for page in presents:
pkg = page.rsplit('_', 1)[0]
@@ -268,8 +269,18 @@ def purge_old_notes(notes):
log.info('There are no notes for ' + pkg + '. Removing old page.')
os.remove(NOTES_PATH + '/' + page)
removed_pages.append(pkg)
- if removed_pages:
- gen_packages_html(removed_pages)
+ for pkg in removed_pages:
+ try:
+ query = 'SELECT s.name ' + \
+ 'FROM results AS r JOIN sources AS s ON r.package_id=s.id ' + \
+ 'WHERE s.name="{pkg}" AND r.status != "" AND s.suite="sid"'
+ query = query.format(pkg=pkg)
+ to_rebuild.append(query_db(query)[0][0])
+ except IndexError: # the package is not tested. this can happen if
+ pass # a package got removed from the archive
+ if to_rebuild:
+ gen_packages_html(to_rebuild)
+
def iterate_over_notes(notes):
num_notes = str(len(notes))