1
0
2017-09-28 16:42:52 +00:00
committed by Git OBS Bridge
parent 13fad4d886
commit 50afa3f705
3 changed files with 84 additions and 14 deletions

View File

@@ -0,0 +1,68 @@
--- openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2017-07-27 02:47:51.000000000 +0200
+++ openjdk/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2017-09-28 17:44:23.511675990 +0200
@@ -31,6 +31,7 @@
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;
@@ -47,6 +48,7 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
+import java.util.Properties;
import java.util.Set;
import java.util.SimpleTimeZone;
import java.util.concurrent.ConcurrentHashMap;
@@ -251,7 +253,17 @@
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
- String libDir = System.getProperty("java.home") + File.separator + "lib";
+ final String homeDir =
+ AccessController.doPrivileged(
+ new sun.security.action.GetPropertyAction("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"))))) {
@@ -264,6 +276,30 @@
}
});
}
+
+ private static String getZoneInfoDir(final String libDir) {
+ return AccessController.doPrivileged (new PrivilegedAction<String>() {
+ public String run() {
+ try {
+ File f = new File(libDir + File.separator + "tz.properties");
+ InputStream in = new FileInputStream(f);
+ BufferedInputStream bin = new BufferedInputStream(in);
+ 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) {

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Sep 28 16:40:43 UTC 2017 - fstrba@suse.com
- Added patch:
* alternative-tzdb_dat.patch
+ Allow specifying alternative path where to find the tzdb.dat
file. With fallback to $JAVA_HOME/jre/lib/tzdb.dat
- Don't symlink tzdb.dat in postinstall
-------------------------------------------------------------------
Thu Sep 21 22:43:35 UTC 2017 - fstrba@suse.com
@@ -6,7 +15,7 @@ Thu Sep 21 22:43:35 UTC 2017 - fstrba@suse.com
-------------------------------------------------------------------
Thu Sep 21 11:41:46 UTC 2017 - fstrba@suse.com
- Allow bootstrapping by itself (BuildConflicts: java-deve >= 1.9)
- Allow bootstrapping by itself (BuildConflicts: java-devel >= 1.9)
-------------------------------------------------------------------
Sat Sep 16 07:29:20 UTC 2017 - fstrba@suse.com

View File

@@ -199,6 +199,7 @@ 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: java-1_8_0-openjdk-linuxfilestore.patch
Patch2003: alternative-tzdb_dat.patch
BuildRequires: alsa-lib-devel
BuildRequires: autoconf
BuildRequires: automake
@@ -346,7 +347,7 @@ Requires: mozilla-nss
%endif
%if 0%{?suse_version} > 1320
# Require zoneinfo data in java8+ format provided by tzdata-java8 subpackage.
Requires(post): tzdata-java8
Requires: tzdata-java8
%endif
%description headless
@@ -570,6 +571,7 @@ patch -p0 -i %{PATCH2000}
patch -p0 -i %{PATCH2001}
patch -p0 -i %{PATCH2002}
patch -p0 -i %{PATCH2003}
(cd openjdk/common/autoconf
bash ./autogen.sh
@@ -615,6 +617,9 @@ echo "" >> $JAVA_HOME/jre/lib/pulseaudio.properties
popd
%endif
# Copy tz.properties
echo "sun.zoneinfo.dir=%{_datadir}/javazi" >> $JAVA_HOME/jre/lib/tz.properties
# Check debug symbols are present and can identify code
SERVER_JVM="$JAVA_HOME/jre/lib/%{archinstall}/server/libjvm.so"
if [ -f "$SERVER_JVM" ] ; then
@@ -868,15 +873,6 @@ update-alternatives \
--slave %{_jvmjardir}/jre-%{javaver} \
jre_%{javaver}_exports %{_jvmjardir}/%{jrelnk}
%if 0%{?suse_version} > 1320
if [ -e %{_datadir}/javazi/tzdb.dat ]; then
if [ -e %{_jvmdir}/%{jredir}/lib/tzdb.dat ]; then
rm -f %{_jvmdir}/%{jredir}/lib/tzdb.dat
fi
ln -sf %{_datadir}/javazi/tzdb.dat %{_jvmdir}/%{jredir}/lib/tzdb.dat
fi
%endif
%postun headless
if [ $1 -eq 0 ]
then
@@ -1106,9 +1102,6 @@ fi
%if 0%{?suse_version} <= 1130
%config(noreplace) %{cacerts}
%endif
%if 0%{?suse_version} > 1320
%ghost %{_jvmdir}/%{jredir}/lib/tzdb.dat
%endif
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/java.policy
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/java.security
%config(noreplace) %{_jvmdir}/%{jredir}/lib/security/blacklisted.certs