Accepting request 1100452 from Java:packages

bsc#1162112 - reproducible uuid generation

OBS-URL: https://build.opensuse.org/request/show/1100452
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xmvn?expand=0&rev=15
This commit is contained in:
Ana Guerrero 2023-07-27 14:51:57 +00:00 committed by Git OBS Bridge
commit 9e3f2e4c57
9 changed files with 67 additions and 0 deletions

31
UUID.patch Normal file
View File

@ -0,0 +1,31 @@
--- xmvn-4.2.0/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/impl/DefaultArtifactInstaller.java 2023-07-24 10:18:52.523347251 +0200
+++ xmvn-4.2.0/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/impl/DefaultArtifactInstaller.java 2023-07-24 11:24:03.362142115 +0200
@@ -185,7 +185,7 @@
am.setNamespace( repo.getNamespace() );
// UUID
- am.setUuid( UUID.randomUUID().toString() );
+ am.setUuid( UUID.nameUUIDFromBytes((System.getenv("SOURCE_DATE_EPOCH")+repo.getNamespace()+artifact.toString()).getBytes()).toString() );
// Compat version
for ( String version : rule.getVersions() )
--- xmvn-4.2.0/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/JavaPackage.java 2023-07-24 10:18:52.523347251 +0200
+++ xmvn-4.2.0/xmvn-tools/xmvn-install/src/main/java/org/fedoraproject/xmvn/tools/install/JavaPackage.java 2023-07-24 11:56:47.481600604 +0200
@@ -58,7 +58,7 @@
super( id );
this.basePackageName = basePackageName;
this.metadataDir = metadataDir;
- metadata.setUuid( UUID.randomUUID().toString() );
+ metadata.setUuid( UUID.nameUUIDFromBytes((System.getenv("SOURCE_DATE_EPOCH")+basePackageName).getBytes()).toString() );
}
/**
@@ -71,7 +71,7 @@
private PackageMetadata getSplitMetadata( String namespace )
{
PackageMetadata splitMetadata = new PackageMetadata();
- splitMetadata.setUuid( UUID.randomUUID().toString() );
+ splitMetadata.setUuid( UUID.nameUUIDFromBytes((System.getenv("SOURCE_DATE_EPOCH")+namespace).getBytes()).toString() );
splitMetadata.setProperties( metadata.getProperties() );
List<ArtifactMetadata> allArtifacts = metadata.getArtifacts();
List<ArtifactMetadata> splitArtifacts =

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jul 24 19:21:09 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* UUID.patch
+ avoid generating random UUIDs, which makes reproducible build
impossible (bsc#1162112)
-------------------------------------------------------------------
Wed May 3 09:26:56 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -28,6 +28,7 @@ Group: Development/Tools/Building
URL: https://fedora-java.github.io/xmvn/
Source0: https://github.com/fedora-java/%{parent}/releases/download/%{version}/%{parent}-%{version}.tar.xz
Source1: %{parent}-build.tar.xz
Patch0: UUID.patch
BuildRequires: %{parent}-api = %{version}
BuildRequires: %{parent}-core = %{version}
BuildRequires: ant

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jul 24 19:21:09 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* UUID.patch
+ avoid generating random UUIDs, which makes reproducible build
impossible (bsc#1162112)
-------------------------------------------------------------------
Wed May 3 09:26:56 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -26,6 +26,7 @@ License: Apache-2.0
Group: Development/Tools/Building
URL: https://fedora-java.github.io/xmvn/
Source0: https://github.com/fedora-java/%{parent}/releases/download/%{version}/%{parent}-%{version}.tar.xz
Patch0: UUID.patch
BuildRequires: %{parent}-api = %{version}
BuildRequires: %{parent}-core = %{version}
BuildRequires: fdupes

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jul 24 19:21:09 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* UUID.patch
+ avoid generating random UUIDs, which makes reproducible build
impossible (bsc#1162112)
-------------------------------------------------------------------
Wed May 3 09:26:56 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -26,6 +26,7 @@ License: Apache-2.0
Group: Development/Tools/Building
URL: https://fedora-java.github.io/xmvn/
Source0: https://github.com/fedora-java/%{parent}/releases/download/%{version}/%{parent}-%{version}.tar.xz
Patch0: UUID.patch
BuildRequires: javapackages-local
BuildRequires: xmvn-resolve
BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jul 24 19:21:09 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* UUID.patch
+ avoid generating random UUIDs, which makes reproducible build
impossible (bsc#1162112)
-------------------------------------------------------------------
Wed May 3 09:26:56 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -27,6 +27,7 @@ Group: Development/Tools/Building
URL: https://fedora-java.github.io/xmvn/
Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/%{parent}-%{version}.tar.xz
Source1: %{parent}-build.tar.xz
Patch0: UUID.patch
BuildRequires: ant
BuildRequires: apache-commons-compress
BuildRequires: atinject