From d4557e599137f217fdbd1b816226f9dd5772e698 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 29 May 2015 16:22:50 +0200 Subject: reproducible: packages: add a cool red flag for packages with notification enabled --- bin/reproducible_html_packages.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index acf769d3..2da881da 100755 --- a/bin/reproducible_html_packages.py +++ b/bin/reproducible_html_packages.py @@ -35,6 +35,9 @@ $links ${suites_links} + + $notify_maintainer + reproducible builds @@ -65,18 +68,19 @@ def check_package_status(package, suite, nocheck=False): version of the package built by jenkins CI """ try: - query = ('SELECT r.status, r.version, r.build_date ' + + query = ('SELECT r.status, r.version, r.build_date, s.notify_maintainer ' + 'FROM results AS r JOIN sources AS s ON r.package_id=s.id ' + 'WHERE s.name="{pkg}" ' + 'AND s.suite="{suite}"').format(pkg=package, suite=suite) result = query_db(query)[0] except IndexError: - query = 'SELECT version FROM sources WHERE name="{pkg}" AND suite="{suite}"' + query = 'SELECT version, notify_maintainer ' + \ + 'FROM sources WHERE name="{pkg}" AND suite="{suite}"' query = query.format(pkg=package, suite=suite) try: - result = query_db(query)[0][0] + result = query_db(query)[0] if result: - result = ('untested', str(result), False) + result = ('untested', str(result[0]), False, result[1]) except IndexError: if nocheck: return False @@ -86,11 +90,12 @@ def check_package_status(package, suite, nocheck=False): raise status = str(result[0]) version = str(result[1]) + notify_maint = u'\u2691' if int(result[3]) == 1 else '' # that's ⚑ if result[2]: build_date = 'at ' + str(result[2]) + ' UTC' else: build_date = 'UNTESTED' - return (status, version, build_date) + return (status, version, build_date, notify_maint) def gen_status_link_icon(status, icon, suite, arch): @@ -214,7 +219,8 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F for pkg in sorted(packages): pkg = str(pkg) try: - status, version, build_date = check_package_status(pkg, suite, nocheck) + pkgstatus = check_package_status(pkg, suite, nocheck) + status, version, build_date, notify_maint = pkgstatus except TypeError: # the package is not in the checked suite continue log.debug('Generating the page of ' + pkg + '/' + suite + '@' + version + @@ -231,6 +237,7 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F version=version, build_time=build_date, links=links, + notify_maintainer=notify_maint, suites_links=suites_links, default_view=default_view) destfile = RB_PKG_PATH + '/' + suite + '/' + arch + '/' + pkg + '.html' -- cgit v1.2.3-70-g09d2