Source: mapproxy Version: 1.15.1-1 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
Hi, Whilst working on the Reproducible Builds effort [0] we noticed that mapproxy could not be built reproducibly. This is because the default value for the "last_change" field in the gpkg sqlite file contains the current date: last_change DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')) Patch attached that uses SOURCE_DATE_EPOCH instead if it's available. [0] https://reproducible-builds.org/ Regards, -- ,''`. : :' : Chris Lamb `. `'` la...@debian.org / chris-lamb.co.uk `-
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible-build.patch 2022-06-15 08:17:12.678035546 +0100 @@ -0,0 +1,48 @@ +Description: Make the build reproducible +Author: Chris Lamb <la...@debian.org> +Last-Update: 2022-06-15 + +--- mapproxy-1.15.1.orig/mapproxy/cache/geopackage.py ++++ mapproxy-1.15.1/mapproxy/cache/geopackage.py +@@ -14,12 +14,14 @@ + # limitations under the License. + + ++import datetime + import hashlib + import logging + import os + import re + import sqlite3 + import threading ++import time + + from mapproxy.cache.base import TileCacheBase, tile_buffer, REMOVE_ON_UNLOCK + from mapproxy.compat import BytesIO, PY2, itertools +@@ -305,6 +307,10 @@ AUTHORITY["EPSG","9122"]],AUTHORITY["EPS + log.info("srs_id already exists.".format(wkt_entry[0])) + db.commit() + ++ last_change = datetime.datetime.utcfromtimestamp( ++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) ++ ) ++ + # Ensure that tile table exists here, don't overwrite a valid entry. + try: + db.execute(""" +@@ -313,6 +319,7 @@ AUTHORITY["EPSG","9122"]],AUTHORITY["EPS + data_type, + identifier, + description, ++ last_change, + min_x, + max_x, + min_y, +@@ -323,6 +330,7 @@ AUTHORITY["EPSG","9122"]],AUTHORITY["EPS + "tiles", + self.table_name, + "Created with Mapproxy.", ++ last_change, + self.tile_grid.bbox[0], + self.tile_grid.bbox[2], + self.tile_grid.bbox[1], --- a/debian/patches/series 2022-06-15 08:07:44.807660859 +0100 --- b/debian/patches/series 2022-06-15 08:17:10.749995438 +0100 @@ -1 +1,2 @@ disable-tag_date.patch +reproducible-build.patch