From d6e72c8e61ae4b037cc5e3edf6835760fd62012b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 4 Oct 2018 23:44:06 +0200 Subject: [PATCH] Set repodata mtime to SOURCE_DATE_EPOCH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit repodata/repomd.xml include timestamps of all the other repodata files. Even when those files are created reproducibly, they have current modification time. In general case this is a good thing (ease checking if repodata cache is up to date). But in case of composing installation image, it breaks reproducibility. Avoid this by instructing createrepo to set mtime and revision to $SOURCE_DATE_EPOCH. Signed-off-by: Marek Marczykowski-Górecki --- pungi/gather.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pungi/gather.py b/pungi/gather.py index d0cacd87..a6a9bd6c 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -1440,6 +1440,9 @@ class Pungi(PungiBase): conf.baseurl = baseurl if compress_type: conf.compress_type = compress_type + if 'SOURCE_DATE_EPOCH' in os.environ: + conf.revision = os.environ['SOURCE_DATE_EPOCH'] + conf.clamp_mtime_to = int(os.environ['SOURCE_DATE_EPOCH']) repomatic = createrepo.MetaDataGenerator(conf) self.logger.info('Making repodata') repomatic.doPkgMetadata()