From aed2bd2d742f344582c3236ef2c206f183dae0a4784f5e3364daf85965985ba7 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 18 Jul 2024 13:21:37 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/javapackages-tools?expand=0&rev=145 --- ...lds-constant-timestamp-for-pom.prope.patch | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/0008-Reproducible-builds-constant-timestamp-for-pom.prope.patch b/0008-Reproducible-builds-constant-timestamp-for-pom.prope.patch index 646cc50..83d5ac1 100644 --- a/0008-Reproducible-builds-constant-timestamp-for-pom.prope.patch +++ b/0008-Reproducible-builds-constant-timestamp-for-pom.prope.patch @@ -1,41 +1,35 @@ -From 1f3c0d52b1e0feb42a48aa8ac8de4f3b37465e4e Mon Sep 17 00:00:00 2001 +From 2ffdd71d859af3254732e30013bfddb2497c8a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Tue, 16 Jul 2024 06:56:39 +0200 Subject: [PATCH 8/8] Reproducible builds: constant timestamp for pom.properties --- - java-utils/maven_depmap.py | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) + java-utils/maven_depmap.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java-utils/maven_depmap.py b/java-utils/maven_depmap.py -index 4bfb877d..74860baf 100644 +index 4bfb877d..693cf5e3 100644 --- a/java-utils/maven_depmap.py +++ b/java-utils/maven_depmap.py -@@ -43,7 +43,8 @@ import sys +@@ -43,7 +43,7 @@ import sys from os.path import basename, dirname import zipfile -from time import gmtime, strftime +import time -+import datetime from copy import deepcopy from javapackages.maven.pom import POM -@@ -172,7 +173,16 @@ def append_if_missing(archive_name, file_name, file_contents): +@@ -172,7 +172,11 @@ def append_if_missing(archive_name, file_name, file_contents): archive = zipfile.ZipFile(archive_name, 'a') try: if file_name not in archive.namelist(): - archive.writestr(file_name, file_contents) -+ date_time = datetime.datetime.fromtimestamp( -+ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())), -+ tz=datetime.timezone.utc, -+ ).timetuple() -+ if date_time[0] < 1980: -+ date_time = (1980, 1, 1, 0, 0, 0) -+ elif date_time[0] > 2107: -+ date_time = (2107, 12, 31, 23, 59, 59) -+ file_zipinfo = zipfile.ZipInfo(file_name, date_time=date_time) ++ file_time = min(4354819199, ++ max(315532800, ++ int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) ++ file_zipinfo = zipfile.ZipInfo(file_name, date_time=time.gmtime(file_time)) + archive.writestr(file_zipinfo, file_contents) finally: archive.close()