summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-03-03 19:34:01 +0100
committerHolger Levsen <holger@layer-acht.org>2015-03-04 01:09:25 +0100
commitdb2c181e5b897fa9160e3d7ae2164973cf370bd2 (patch)
tree7785f420b5de176e1041054fd66529143baa394a /bin
parentb35ea9da45926eda7831f3de28d2e4a0002046e2 (diff)
downloadjenkins.debian.net-db2c181e5b897fa9160e3d7ae2164973cf370bd2.tar.xz
reproducible: html_packages: stop assuming sid/amd64 if no suite/arch is passed to gen_packages_html. Instead, generate pages for all suites/arches
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_html_packages.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index 8fa02cf7..8fa71420 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -56,7 +56,7 @@ def sizeof_fmt(num):
num /= 1024.0
return str(int(round(float("%f" % num), 0))) + "%s" % ('Yi')
-def check_package_status(package, suite):
+def check_package_status(package, suite, nocheck=False):
"""
This returns a tuple containing status, version and build_date of the last
version of the package built by jenkins CI
@@ -68,6 +68,8 @@ def check_package_status(package, suite):
'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 + '.')
@@ -139,19 +141,31 @@ def gen_bugs_links(package, bugs):
return html
-def gen_packages_html(packages, suite='sid', arch='amd64', no_clean=False):
+def gen_packages_html(packages, suite=None, arch=None, no_clean=False, nocheck=False):
"""
generate the /rb-pkg/package.html page
packages should be a list
+ If suite and/or arch is not passed, then build that packages for all suites
+ nocheck is for internal use
"""
bugs = get_bugs()
log.debug(str(len(bugs)) + ' bugs found: ' + str(bugs))
total = len(packages)
log.info('Generating the pages of ' + str(total) + ' package(s)')
+ if not nocheck and not suite and not arch:
+ nocheck = True
+ if nocheck and not suite and not arch:
+ for lsuite in SUITES:
+ for larch in ARCHES:
+ gen_packages_html(packages, lsuite, larch, no_clean, True)
+ return
for pkg in sorted(packages):
pkg = str(pkg)
- status, version, build_date = check_package_status(pkg, suite)
- log.info('Generating the page of ' + pkg + ' ' + version +
+ try:
+ status, version, build_date = check_package_status(pkg, suite, nocheck)
+ except TypeError: # the package is not in the checked suite
+ continue
+ log.info('Generating the page of ' + pkg + '/' + suite + '@' + version +
' built at ' + build_date)
links, default_view = gen_extra_links(pkg, version, suite, arch)