Accepting request 1113584 from Java:packages

reproducible improvements

OBS-URL: https://build.opensuse.org/request/show/1113584
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mysql-connector-java?expand=0&rev=47
This commit is contained in:
Ana Guerrero 2023-09-26 20:02:18 +00:00 committed by Git OBS Bridge
commit a297425252
3 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Sep 26 05:14:00 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Added patch:
* reproducible-build.patch
+ keep PropertyDefinitions sorted to achieve reproducible order
of getters/setters in generated class files
-------------------------------------------------------------------
Mon Sep 25 09:45:21 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -37,6 +37,7 @@ Patch0: javac-check.patch
# The patch doesn't remove the file AuthenticationOciClient.java
# therefore it's removed during prep phase
Patch1: %{name}-remove-oci-support.patch
Patch2: reproducible-build.patch
BuildRequires: ant
BuildRequires: ant-contrib
BuildRequires: apache-commons-logging
@ -80,6 +81,7 @@ set that supports the capabilities of MySQL.
%setup -q -n mysql-connector-j-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%if 0%{?suse_version} <= 1500 && 0%{?sle_version} <= 150200
# ship protobuf generated files compatible with protobuf 3.9.2

20
reproducible-build.patch Normal file
View File

@ -0,0 +1,20 @@
--- mysql-connector-j-8.1.0/src/main/core-api/java/com/mysql/cj/conf/PropertyDefinitions.java 2023-09-26 06:49:03.580772166 +0200
+++ mysql-connector-j-8.1.0/src/main/core-api/java/com/mysql/cj/conf/PropertyDefinitions.java 2023-09-26 06:53:10.775563886 +0200
@@ -30,7 +30,7 @@
package com.mysql.cj.conf;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.TreeMap;
import java.util.Map;
import com.mysql.cj.Messages;
@@ -895,7 +895,7 @@
//
};
- HashMap<PropertyKey, PropertyDefinition<?>> propertyKeyToPropertyDefinitionMap = new HashMap<>();
+ TreeMap<PropertyKey, PropertyDefinition<?>> propertyKeyToPropertyDefinitionMap = new TreeMap<>();
for (PropertyDefinition<?> pdef : pdefs) {
propertyKeyToPropertyDefinitionMap.put(pdef.getPropertyKey(), pdef);
}