diff options
Diffstat (limited to 'bin/reproducible_common.py')
-rwxr-xr-x | bin/reproducible_common.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 1c2df8ea..dd67f467 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -17,8 +17,9 @@ import csv import json import errno import atexit -import sqlite3 +import hashlib import logging +import sqlite3 import argparse import pystache import psycopg2 @@ -54,6 +55,7 @@ TEMP_PATH="/tmp/reproducible" REPRODUCIBLE_JSON = BASE + '/reproducible.json' REPRODUCIBLE_TRACKER_JSON = BASE + '/reproducible-tracker.json' REPRODUCIBLE_DB = '/var/lib/jenkins/reproducible.db' +REPRODUCIBLE_STYLES = BASE +'/static/style.css' DEBIAN_URI = '/debian' DBD_URI = '/debian/dbd' @@ -145,6 +147,12 @@ if args.ignore_missing_files: tab = ' ' +# take a SHA1 of the css page for style version +hasher = hashlib.sha1() +with open(REPRODUCIBLE_STYLES, 'rb') as f: + hasher.update(f.read()) +REPRODUCIBLE_STYLE_SHA1 = hasher.hexdigest() + # Templates used for creating package pages renderer = pystache.Renderer() status_icon_link_template = renderer.load_template( @@ -316,6 +324,7 @@ def write_html_page(title, body, destfile, no_header=False, style_note=False, 'navigation_html': left_nav_html, 'main_header': title if not no_header else "", 'main_html': body, + 'style_dot_css_sha1sum': REPRODUCIBLE_STYLE_SHA1, } html = renderer.render(basic_page_template, context) |