[tzdata/f14] Fix building of Java zones

Petr Machata pmachata at fedoraproject.org
Thu Nov 3 21:28:51 UTC 2011


commit 81ac29046466476ffc6dcaddc9721475b78aa53e
Author: Petr Machata <pmachata at redhat.com>
Date:   Thu Nov 3 22:27:14 2011 +0100

    Fix building of Java zones

 javazic-exclusion-fix.patch |   42 ++++++++++++++++++++++++++++++++++++++++++
 tzdata.spec                 |   11 ++++++++---
 2 files changed, 50 insertions(+), 3 deletions(-)
---
diff --git a/javazic-exclusion-fix.patch b/javazic-exclusion-fix.patch
new file mode 100644
index 0000000..b9dfa4b
--- /dev/null
+++ b/javazic-exclusion-fix.patch
@@ -0,0 +1,42 @@
+# Patch based on fix in JDK8 tree by Yuka Kamiya from Oracle:
+# http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f114bddac6d6
+
+diff -up ./sun/tools/javazic/Mappings.java.sav ./sun/tools/javazic/Mappings.java
+--- ./sun/tools/javazic/Mappings.java.sav	2011-11-03 16:31:53.000000000 -0400
++++ ./sun/tools/javazic/Mappings.java	2011-11-03 16:41:44.000000000 -0400
+@@ -77,15 +77,17 @@ class Mappings {
+ 	    int rawOffset = zone.get(zone.size()-1).getGmtOffset();
+ 	    // If the GMT offset of this Zone will change in some
+ 	    // future time, this Zone is added to the exclude list.
+-	    if (zone.size() > 1) {
+-		ZoneRec zrec = zone.get(zone.size()-2);
++	    boolean isExcluded = false;
++	    for (int i = 0; i < zone.size(); i++) {
++		ZoneRec zrec = zone.get(i);
+ 		if ((zrec.getGmtOffset() != rawOffset)
+ 		    && (zrec.getUntilTime(0) > Time.getCurrentTime())) {
+ 		    if (excludeList == null) {
+ 			excludeList = new ArrayList<String>();
+ 		    }
+ 		    excludeList.add(zone.getName());
+-		    continue;
++		    isExcluded = true;
++		    break;
+ 		}
+ 	    }
+ 
+@@ -101,9 +103,13 @@ class Mappings {
+ 		rawOffsetsIndex.add(i, rawOffset);
+ 
+ 		Set<String> perRawOffset = new TreeSet<String>();
++		if (!isExcluded) {
++		    perRawOffset = new TreeSet<String>();
++		}
++
+ 		perRawOffset.add(zonename);
+ 		rawOffsetsIndexTable.add(i, perRawOffset);
+-	    } else {
++	    } else if (!isExcluded) {
+ 		int i = rawOffsetsIndex.indexOf(new Integer(rawOffset));
+ 		Set<String> perRawOffset = rawOffsetsIndexTable.get(i);
+ 		perRawOffset.add(zonename);
diff --git a/tzdata.spec b/tzdata.spec
index a3b613e..7cb4598 100644
--- a/tzdata.spec
+++ b/tzdata.spec
@@ -3,7 +3,7 @@ Name: tzdata
 Version: 2011n
 %define tzdata_version 2011n
 %define tzcode_version 2011i
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: Public Domain
 Group: System Environment/Base
 URL: ftp://munnari.oz.au/pub/
@@ -34,7 +34,8 @@ the world.
 Summary: Timezone data for Java
 Group: System Environment/Base
 Source3: javazic.tar.gz
-Patch0: javazic-fixup.patch
+Patch100: javazic-fixup.patch
+Patch101: javazic-exclusion-fix.patch
 
 %description java
 This package contains timezone information for use by Java runtimes.
@@ -55,7 +56,8 @@ sed -e 's|@objpfx@|'`pwd`'/obj/|' \
 mkdir javazic
 tar zxf %{SOURCE3} -C javazic
 pushd javazic
-%patch0
+%patch100
+%patch101
 
 # Hack alert! sun.tools may be defined and installed in the
 # VM. In order to guarantee that we are using IcedTea/OpenJDK
@@ -111,6 +113,9 @@ rm -rf %{buildroot}
 %{_datadir}/javazi
 
 %changelog
+* Thu Nov  3 2011 Petr Machata <pmachata at redhat.com> - 2011n-2
+- Fix building of Java zones.  Patch by Deepak Bhole
+
 * Mon Oct 31 2011 Petr Machata <pmachata at redhat.com> - 2011l-1
 - Rebase to 2011n
   - Drop all patches, including the Kemerovo patch, which is not in


More information about the scm-commits mailing list