From 243d7fdac173df2d4290f6540ce9f2df0bcb4afb Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 15 Mar 2015 11:53:47 +0100 Subject: reproducible: deal with removed packages gracefully --- bin/reproducible_html_notes.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bin/reproducible_html_notes.py') 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'}, '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 -- cgit v1.2.3-54-g00ecf