summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_html_notes.py
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-03-15 11:53:47 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-15 12:24:57 +0100
commit243d7fdac173df2d4290f6540ce9f2df0bcb4afb (patch)
treefe9b0cd8a1dd87a56251f26e6fc7fa07d7f57974 /bin/reproducible_html_notes.py
parent914fb94cac23f7f57df3308f51d2d81ede56cb12 (diff)
downloadjenkins.debian.net-243d7fdac173df2d4290f6540ce9f2df0bcb4afb.tar.xz
reproducible: deal with removed packages gracefully
Diffstat (limited to 'bin/reproducible_html_notes.py')
-rwxr-xr-xbin/reproducible_html_notes.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index fc906b7c..e1b98818 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -10,6 +10,7 @@
#
# Build html pages based on the content of the notes.git repository
+import copy
import yaml
from reproducible_common import *
from reproducible_html_packages import gen_packages_html
@@ -152,11 +153,12 @@ def load_notes():
{ 'package_name': {'version': '0.0', 'comments'<etc>}, 'package_name':{} }
"""
with open(NOTES) as fd:
- notes = yaml.load(fd)
- log.debug("notes loaded. There are " + str(len(notes)) +
+ possible_notes = yaml.load(fd)
+ log.debug("notes loaded. There are " + str(len(possible_notes)) +
" package listed")
- for package in notes: # check if every package listed on the notes
- try: # actually have been tested
+ notes = copy.copy(possible_notes)
+ for package in possible_notes: # check if every package listed on the notes
+ try: # actually have been tested
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 != ""'
@@ -166,6 +168,8 @@ def load_notes():
log.warning("This query produces no results: " + query)
log.warning("This means there is no tested package with the name " + package + ".")
del notes[package]
+ log.debug("notes checked. There are " + str(len(notes)) +
+ " package listed")
return notes