1
0

Accepting request 1188405 from Java:packages

some reproducible mtimes

OBS-URL: https://build.opensuse.org/request/show/1188405
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/javapackages-tools?expand=0&rev=41
This commit is contained in:
Ana Guerrero 2024-07-19 13:26:00 +00:00 committed by Git OBS Bridge
commit e8501296d1
3 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,39 @@
From 2ffdd71d859af3254732e30013bfddb2497c8a41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
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 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/java-utils/maven_depmap.py b/java-utils/maven_depmap.py
index 4bfb877d..693cf5e3 100644
--- a/java-utils/maven_depmap.py
+++ b/java-utils/maven_depmap.py
@@ -43,7 +43,7 @@ import sys
from os.path import basename, dirname
import zipfile
-from time import gmtime, strftime
+import time
from copy import deepcopy
from javapackages.maven.pom import POM
@@ -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)
+ 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()
--
2.45.2

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Jul 18 12:15:00 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* 0008-Reproducible-builds-constant-timestamp-for-pom.prope.patch
+ use reproducible timestamp when post-processing jar files and
adding there the pom.properties file.
-------------------------------------------------------------------
Wed Oct 4 07:18:58 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file
# spec file for package javapackages-tools
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -59,6 +59,8 @@ Patch7: 0005-Interpolate-properties-also-in-the-current-artifact.patch
Patch8: 0006-Test-variable-expansion-in-artifactId.patch
#PATCH-FIX-UPSTREAM: test gracious handling of <relativePath/> construct
Patch9: 0007-Test-that-we-don-t-bomb-on-relativePath.patch
#PATCH-FIX-UPSTREAM: make the pom.properties have reproducible timestamp
Patch10: 0008-Reproducible-builds-constant-timestamp-for-pom.prope.patch
BuildRequires: asciidoc
BuildRequires: fdupes
BuildRequires: perl