From 0ee95e20985c4dda8be2fb76af0f1eb54881499e6c46bcef7623c8cc74678dab Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 7 Mar 2024 13:07:10 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:Factory/java-17-openj9?expand=0&rev=63 --- alternative-tzdb_dat.patch | 111 ------------------------------------- java-17-openj9.changes | 8 +++ java-17-openj9.spec | 7 --- 3 files changed, 8 insertions(+), 118 deletions(-) delete mode 100644 alternative-tzdb_dat.patch diff --git a/alternative-tzdb_dat.patch b/alternative-tzdb_dat.patch deleted file mode 100644 index 67e7ac7..0000000 --- a/alternative-tzdb_dat.patch +++ /dev/null @@ -1,111 +0,0 @@ ---- a/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java -+++ b/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java -@@ -74,6 +74,7 @@ import java.util.HashSet; - import java.util.List; - import java.util.Map; - import java.util.NavigableMap; -+import java.util.Properties; - import java.util.Set; - import java.util.TreeMap; - import java.util.concurrent.ConcurrentHashMap; -@@ -106,7 +107,14 @@ final class TzdbZoneRulesProvider extends ZoneRulesProvider { - */ - public TzdbZoneRulesProvider() { - try { -- String libDir = StaticProperty.javaHome() + File.separator + "lib"; -+ final String homeDir = StaticProperty.javaHome(); -+ if (homeDir == null) { -+ throw new Error("java.home is not set"); -+ } -+ String libDir = homeDir + File.separator + "lib"; -+ String otherDir = getZoneInfoDir(homeDir); -+ if (otherDir != null) -+ libDir = otherDir; - try (DataInputStream dis = new DataInputStream( - new BufferedInputStream(new FileInputStream( - new File(libDir, "tzdb.dat"))))) { -@@ -117,6 +125,28 @@ final class TzdbZoneRulesProvider extends ZoneRulesProvider { - } - } - -+ private static String getZoneInfoDir(final String homeDir) { -+ try { -+ File f = new File(homeDir + File.separator + "conf" + -+ File.separator + "tz.properties"); -+ if (!f.exists()) -+ return null; -+ BufferedInputStream bin = new BufferedInputStream(new FileInputStream(f)); -+ Properties props = new Properties(); -+ props.load(bin); -+ bin.close(); -+ String dir = props.getProperty("sun.zoneinfo.dir"); -+ if (dir == null) -+ return null; -+ File tzdbdat = new File(dir, "tzdb.dat"); -+ if (tzdbdat.exists()) -+ return dir; -+ return null; -+ } catch (Exception x) { -+ return null; -+ } -+ } -+ - @Override - protected Set provideZoneIds() { - return new HashSet<>(regionIds); ---- a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java -+++ b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java -@@ -45,6 +45,7 @@ import java.util.HashMap; - import java.util.List; - import java.util.Locale; - import java.util.Map; -+import java.util.Properties; - import java.util.SimpleTimeZone; - import java.util.concurrent.ConcurrentHashMap; - import java.util.zip.CRC32; -@@ -252,7 +253,15 @@ public final class ZoneInfoFile { - AccessController.doPrivileged(new PrivilegedAction() { - public Void run() { - try { -- String libDir = StaticProperty.javaHome() + File.separator + "lib"; -+ final String homeDir = StaticProperty.javaHome(); -+ if (homeDir == null) { -+ throw new Error("java.home is not set"); -+ } -+ String libDir = homeDir + File.separator + "lib"; -+ String otherDir = getZoneInfoDir(homeDir); -+ if (otherDir != null) -+ libDir = otherDir; -+ - try (DataInputStream dis = new DataInputStream( - new BufferedInputStream(new FileInputStream( - new File(libDir, "tzdb.dat"))))) { -@@ -266,6 +275,28 @@ public final class ZoneInfoFile { - }); - } - -+ private static String getZoneInfoDir(final String homeDir) { -+ try { -+ File f = new File(homeDir + File.separator + "conf" + -+ File.separator + "tz.properties"); -+ if (!f.exists()) -+ return null; -+ BufferedInputStream bin = new BufferedInputStream(new FileInputStream(f)); -+ Properties props = new Properties(); -+ props.load(bin); -+ bin.close(); -+ String dir = props.getProperty("sun.zoneinfo.dir"); -+ if (dir == null) -+ return null; -+ File tzdbdat = new File(dir, "tzdb.dat"); -+ if (tzdbdat.exists()) -+ return dir; -+ return null; -+ } catch (Exception x) { -+ return null; -+ } -+ } -+ - private static void addOldMapping() { - for (String[] alias : oldMappings) { - aliases.put(alias[0], alias[1]); diff --git a/java-17-openj9.changes b/java-17-openj9.changes index 0988e3c..7fc04b3 100644 --- a/java-17-openj9.changes +++ b/java-17-openj9.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Mar 7 12:44:28 UTC 2024 - Fridrich Strba + +- Removed patch: + * alternative-tzdb_dat.patch + + Remove the possibility to use the system timezone-java. It + creates more problems then it solves (bsc#1213470) + ------------------------------------------------------------------- Tue Feb 20 15:41:46 UTC 2024 - Fridrich Strba diff --git a/java-17-openj9.spec b/java-17-openj9.spec index 9c1887d..1368dab 100644 --- a/java-17-openj9.spec +++ b/java-17-openj9.spec @@ -126,7 +126,6 @@ Patch32: stringop-overflow.patch # OpenJDK specific patches # Patch302: disable-doclint-by-default.patch -Patch303: alternative-tzdb_dat.patch # BuildRequires: alsa-lib-devel BuildRequires: autoconf @@ -242,7 +241,6 @@ Requires(post): java-ca-certificates Requires(post): update-alternatives # Postun requires update-alternatives to uninstall tool update-alternatives. Requires(postun): update-alternatives -Recommends: tzdata-java8 Obsoletes: %{name}-accessibility %if 0%{?suse_version} > 1500 || 0%{?java_bootstrap} # Standard JPackage base provides. @@ -378,7 +376,6 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2* %patch -P 32 -p1 %patch -P 302 -p1 -%patch -P 303 -p1 cat %{SOURCE100} \ | sed "s/@OPENJ9_SHA@/`expr substr '%{openj9_revision}' 1 7`/g" \ @@ -451,9 +448,6 @@ find %{imagesdir}/jdk -iname '*.debuginfo' -exec rm {} \; export JAVA_HOME=$(pwd)/%{imagesdir}/jdk -# Copy tz.properties -echo "sun.zoneinfo.dir=%{_datadir}/javazi" >> $JAVA_HOME/conf/tz.properties - # cacerts are generated in runtime in openSUSE if [ -f %{imagesdir}/jdk/lib/security/cacerts ]; then rm %{imagesdir}/jdk/lib/security/cacerts @@ -782,7 +776,6 @@ fi %{_jvmdir}/%{sdkdir}/conf/security/policy/unlimited/default_local.policy %{_jvmdir}/%{sdkdir}/conf/security/policy/unlimited/default_US_export.policy %{_jvmdir}/%{sdkdir}/conf/sound.properties -%{_jvmdir}/%{sdkdir}/conf/tz.properties %{_jvmdir}/%{sdkdir}/lib/J9TraceFormat.dat %{_jvmdir}/%{sdkdir}/lib/OMRTraceFormat.dat %{_jvmdir}/%{sdkdir}/lib/default/j9ddr.dat