summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.py
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-07-25 15:53:25 -0400
committerHolger Levsen <holger@layer-acht.org>2016-07-26 06:59:31 -0400
commitc343ba988c2b2cd3dbdedede2f615a682e486aea (patch)
tree4127a0df046aef7e6f9249100fc4c048cd3b685f /bin/reproducible_common.py
parentf1237c7a9b89768a4ce005ede78d25e8661e4625 (diff)
downloadjenkins.debian.net-c343ba988c2b2cd3dbdedede2f615a682e486aea.tar.xz
reproducible debian: add versioning to css style sheets
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_common.py')
-rwxr-xr-xbin/reproducible_common.py11
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)