diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-03-06 18:59:00 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-03-06 20:08:25 +0100 |
commit | 62a956483e4163bff07a2cba9aa272ff0da2c3c1 (patch) | |
tree | 87eda9e19eca30c075124bd46933596a23029840 | |
parent | 4c3f0e1e29dc7efaac31e10cf656f510257df15e (diff) | |
download | jenkins.debian.net-62a956483e4163bff07a2cba9aa272ff0da2c3c1.tar.xz |
reproducible: html_packages: build pages also for untested packages. Add another icon
-rwxr-xr-x | bin/reproducible_common.py | 1 | ||||
-rwxr-xr-x | bin/reproducible_html_packages.py | 37 | ||||
-rw-r--r-- | userContent/static/weather-clear-night.png | bin | 0 -> 961 bytes |
3 files changed, 23 insertions, 15 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index ff5496e0..554e95ed 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -336,6 +336,7 @@ def join_status_icon(status, package=None, version=None): '404': 'weather-severe-alert.png', 'not for us': 'weather-few-clouds-night.png', 'not_for_us': 'weather-few-clouds-night.png', + 'untested': 'weather-clear-night.png', 'blacklisted': 'error.png'} if status == 'unreproducible': status = 'FTBR' diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index 197e96bc..442edee6 100755 --- a/bin/reproducible_html_packages.py +++ b/bin/reproducible_html_packages.py @@ -19,7 +19,7 @@ html_package_page = Template((tab*2).join((""" <a href="/index_$status.html" target="_parent" title="$status"> <img src="/static/$icon" alt="$status" /> </a> - <span style="font-size:0.9em;">at $build_time:</span> + <span style="font-size:0.9em;">$build_time:</span> $links <a href="https://tracker.debian.org/$package" target="main">PTS</a> <a href="https://bugs.debian.org/src:$package" target="main">BTS</a> @@ -69,15 +69,25 @@ def check_package_status(package, suite, nocheck=False): 'AND s.suite="{suite}"').format(pkg=package, suite=suite) result = query_db(query)[0] except IndexError: - if nocheck: - return False - print_critical_message('This query produces no results: ' + query + - '\nThis means there is no tested package with the name ' + - package + '.') - raise + query = 'SELECT version FROM sources WHERE name="{pkg}" AND suite="{suite}"' + query = query.format(pkg=package, suite=suite) + try: + result = query_db(query)[0][0] + if result: + result = ('untested', str(result), False) + except IndexError: + if nocheck: + return False + print_critical_message('This query produces no results: ' + query + + '\nThis means there is no available package with the name ' + + package + '.') + raise status = str(result[0]) version = str(result[1]) - build_date = str(result[2])+" UTC" + if result[2]: + build_date = 'at ' + str(result[2]) + ' UTC' + else: + build_date = '<span style="color:red;font-weight:bold;">UNTESTED</span>' return (status, version, build_date) def gen_extra_links(package, version, suite, arch): @@ -132,7 +142,7 @@ def gen_extra_links(package, version, suite, arch): def gen_suites_links(package, suite): html = '' query = 'SELECT s.suite, s.architecture ' + \ - 'FROM sources AS s JOIN results AS r ON r.package_id=s.id ' + \ + 'FROM sources AS s ' + \ 'WHERE s.name="{pkg}"'.format(pkg=package) results = query_db(query) if len(results) < 1: @@ -215,9 +225,7 @@ def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=F purge_old_pages() # housekeep is always good def gen_all_rb_pkg_pages(suite='sid', arch='amd64', no_clean=False): - query = 'SELECT s.name ' + \ - 'FROM results AS r JOIN sources AS s ON r.package_id=s.id ' + \ - 'WHERE r.status !="" AND s.suite="%s"' % suite + query = 'SELECT name FROM sources WHERE suite="%s" AND architecture="%s"' % (suite, arch) rows = query_db(query) pkgs = [str(i[0]) for i in rows] log.info('Processing all the package pages, ' + str(len(pkgs))) @@ -238,9 +246,8 @@ def purge_old_pages(): for page in presents: pkg = page.rsplit('.', 1)[0] query = 'SELECT s.name ' + \ - 'FROM results AS r ' + \ - 'JOIN sources AS s ON r.package_id=s.id ' + \ - 'WHERE s.name="{name}" AND r.status != "" ' + \ + 'FROM sources AS s ' + \ + 'WHERE s.name="{name}" ' + \ 'AND s.suite="{suite}" AND s.architecture="{arch}"' query = query.format(name=pkg, suite=suite, arch=arch) result = query_db(query) diff --git a/userContent/static/weather-clear-night.png b/userContent/static/weather-clear-night.png Binary files differnew file mode 100644 index 00000000..43457526 --- /dev/null +++ b/userContent/static/weather-clear-night.png |