Skip to content

Commit

Permalink
Merge pull request #585 from sebastic/reproducible-build
Browse files Browse the repository at this point in the history
Make the build reproducible
  • Loading branch information
weskamm committed Nov 24, 2023
2 parents 0d3d382 + 839e4f8 commit 687b190
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mapproxy/cache/geopackage.py
Expand Up @@ -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
Expand Down Expand Up @@ -311,6 +313,10 @@ def _initialize_gpkg(self):
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("""
Expand All @@ -319,16 +325,18 @@ def _initialize_gpkg(self):
data_type,
identifier,
description,
last_change,
min_x,
max_x,
min_y,
max_y,
srs_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
""", (self.table_name,
"tiles",
self.table_name,
"Created with Mapproxy.",
last_change,
self.bbox[0],
self.bbox[2],
self.bbox[1],
Expand Down

0 comments on commit 687b190

Please sign in to comment.