Skip to content
Commits on Source (2)
......@@ -13,7 +13,6 @@ import os
import yaml
import json
import apt_pkg
apt_pkg.init_system()
from sqlalchemy import sql
from rblib import db_table, query_db
......@@ -21,6 +20,7 @@ from rblib.confparse import log
from rblib.const import conn_db
from rblib.utils import print_critical_message, irc_msg
apt_pkg.init_system()
NOTES = 'packages.yml'
ISSUES = 'issues.yml'
......@@ -48,20 +48,25 @@ def load_notes():
except AssertionError:
print_critical_message(pkg + ' does not include a version')
irc_msg('The note for ' + pkg + ' does not include a version.')
# We are only dealing with notes targetting debian, so hardcode it here
# for now. Need to be rethought as a whole when multi-distro notes comes
query = """SELECT s.id, s.version, s.suite
FROM results AS r JOIN sources AS s ON r.package_id=s.id
WHERE s.name='{pkg}' AND r.status != ''"""
# AND s.architecture='amd64'"""
FROM results AS r
JOIN sources AS s ON r.package_id=s.id
JOIN distributions AS d on d.id=s.distribution
WHERE d.name = 'debian'
AND s.name='{pkg}' AND r.status != ''"""
query = query.format(pkg=pkg)
result = query_db(query)
if not result:
log.info('Warning: This query produces no results: ' + query
+ '\nThis means there is no tested ' +
'package with the name ' + pkg)
log.info('Warning: This query produces no results: %s'
'\nThis means there is no tested package with the name %s',
query, pkg)
try:
irc_msg("There is problem with the note for {} (it may "
"have been removed from the archive). Please check {} and {}".
format(pkg, os.environ['BUILD_URL'],
"have been removed from the archive). "
"Please check {} and {}".format(
pkg, os.environ['BUILD_URL'],
"https://tracker.debian.org/pkg/" + pkg))
except KeyError:
log.error('There is a problem with the note for %s - please '
......