1
0
Fridrich Strba 2017-11-03 11:38:38 +00:00 committed by Git OBS Bridge
parent 47a7363ada
commit f3a6790745
3 changed files with 72 additions and 1 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Nov 3 11:36:40 UTC 2017 - fstrba@suse.com
- Added patch:
* tzdb_dat.patch
+ Patch also the other place in jdk that loads the tzdb.dat
file
-------------------------------------------------------------------
Thu Nov 2 06:30:45 UTC 2017 - fstrba@suse.com

View File

@ -204,6 +204,7 @@ Patch1000: icedtea-3.0.1-sunec.patch
Patch1001: java-1_8_0-openjdk-suse-desktop-files.patch
Patch2000: java-1_8_0-openjdk-gcc6.patch
Patch2001: disable-doclint-by-default.patch
Patch2002: tzdb_dat.patch
BuildRequires: alsa-lib-devel
BuildRequires: autoconf
BuildRequires: automake
@ -255,7 +256,7 @@ Provides: jre1.6.x
Provides: jre1.7.x
Provides: jre1.8.x
%if %{with bootstrap}
BuildRequires: java-devel >= 1.7
BuildRequires: java-devel == 1.8.0
BuildConflicts: java-devel >= 1.9
%else
BuildRequires: %{name}-devel
@ -542,6 +543,7 @@ patch -p0 -i %{PATCH104}
patch -p0 -i %{PATCH2000}
patch -p0 -i %{PATCH2001}
patch -p0 -i %{PATCH2002}
(cd openjdk/common/autoconf
bash ./autogen.sh

61
tzdb_dat.patch Normal file
View File

@ -0,0 +1,61 @@
--- openjdk/jdk/src/share/classes/java/time/zone/TzdbZoneRulesProvider.java 2017-10-30 18:28:40.000000000 +0100
+++ openjdk/jdk/src/share/classes/java/time/zone/TzdbZoneRulesProvider.java 2017-11-03 11:51:41.617320377 +0100
@@ -74,6 +74,7 @@
import java.util.Map;
import java.util.NavigableMap;
import java.util.Objects;
+import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
@@ -106,7 +107,15 @@
*/
public TzdbZoneRulesProvider() {
try {
- String libDir = System.getProperty("java.home") + File.separator + "lib";
+ final String homeDir = System.getProperty("java.home");
+ if (homeDir == null) {
+ throw new Error("java.home is not set");
+ }
+ String libDir = homeDir + File.separator + "lib";
+ String otherDir = getZoneInfoDir(libDir);
+ if (otherDir != null)
+ libDir = otherDir;
+
try (DataInputStream dis = new DataInputStream(
new BufferedInputStream(new FileInputStream(
new File(libDir, "tzdb.dat"))))) {
@@ -117,6 +126,23 @@
}
}
+ private static String getZoneInfoDir(final String libDir) {
+ File f = new File(libDir + File.separator + "tz.properties");
+ try (BufferedInputStream bin = new BufferedInputStream(new FileInputStream(f))) {
+ Properties props = new Properties();
+ props.load(bin);
+ 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<String> provideZoneIds() {
return new HashSet<>(regionIds);
--- openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2017-10-30 18:28:40.000000000 +0100
+++ openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2017-11-03 11:18:55.381711882 +0100
@@ -31,7 +31,6 @@
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
-import java.io.InputStream;
import java.io.IOException;
import java.io.StreamCorruptedException;
import java.security.AccessController;