From 610098b260ea448af23f9a5fd8b31ae422a6c7d8 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Wed, 11 Feb 2015 00:11:29 +0100 Subject: reproducible: check notes for validity. Check whether the package actually exists and was tested --- bin/reproducible_html_notes.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py index dbde9474..4d593a83 100755 --- a/bin/reproducible_html_notes.py +++ b/bin/reproducible_html_notes.py @@ -148,6 +148,17 @@ def load_notes(): notes = yaml.load(fd) log.debug("notes loaded. There are " + str(len(notes)) + " package listed") + for package in notes: # check if every pacakge listed on the notes + try: # actually have been tested + query = 'SELECT name ' + \ + 'FROM source_packages ' + \ + 'WHERE name="%s"' % package + result = query_db(query)[0] + except IndexError: + print_critical_message('This query produces no results: ' + query + + '\nThis means there is no tested package with the name ' + + package + '.') + raise return notes -- cgit v1.2.3-70-g09d2