From iag at ribbit.SFBay.Sun.COM Wed Aug 8 17:08:16 2007 From: iag at ribbit.SFBay.Sun.COM (Iris Garcia) Date: Wed, 8 Aug 2007 17:08:16 -0700 (PDT) Subject: Using system tzdata In-Reply-To: <46BA1C18.1030704@redhat.com> (message from Keith Seitz on Wed, 08 Aug 2007 12:40:08 -0700) Message-ID: <200708090008.l7908GHP025455@ribbit.SFBay.Sun.COM> Hi, Keith. The timezone information files are owned by the i18n team (i18n-dev at openjdk.java.net). They should be able to provide you with guidance. Thanks, iris > Date: Wed, 08 Aug 2007 12:40:08 -0700 > From: Keith Seitz > Subject: Using system tzdata > > Hi, > > The JRE contains pre-compiled timezone information files. As an OS > vendor, Red Hat would prefer not to respin or repackage the JRE every > time tzdata changes somewhere in the world. > > In order to facilitate this, we're in the process of modifying our > tzdata package to include pre-compiled zoneinfo files for use with JREs. > I have created a patch to the openjdk JRE that would optionally use > these files instead of the pre-packaged ones in the JRE. > > We would really like to solicit advice/comments about how to get > something like this accepted upstream so that other distros can use this. > > Keith > > > --- openjdk/hotspot/src/os/linux/vm/os_linux.cpp.keiths 2007-08-01 10:21:19.000000000 -0700 > +++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2007-08-01 10:21:36.000000000 -0700 > @@ -376,6 +376,10 @@ > } > } > > + // Use the system zoneinfo files, if present > + SystemProperty* sp = Arguments::system_properties(); > + Arguments::PropertyList_add (&sp, > + "java.zoneinfo.dir", "/usr/share/zoneinfo/java"); > #undef malloc > #undef getenv > #undef EXTENSIONS_DIR > --- openjdk/j2se/src/share/classes/sun/util/calendar/ZoneInfoFile.java.keiths 2007-08-01 12:31:03.000000000 -0700 > +++ openjdk/j2se/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2007-08-01 12:29:44.000000000 -0700 > @@ -1021,10 +1021,18 @@ > byte[] buffer = null; > > try { > - String homeDir = (String) AccessController.doPrivileged( > + String zi_dir = (String) AccessController.doPrivileged( > + new sun.security.action.GetPropertyAction("java.zoneinfo.dir")); > + File dir = null; > + if (zi_dir != null) > + dir = new File(zi_dir); > + if (dir == null || !dir.exists() || !dir.isDirectory()) { > + String homeDir = (String) AccessController.doPrivileged( > new sun.security.action.GetPropertyAction("java.home")); > - final String fname = homeDir + File.separator + "lib" + File.separator > - + "zi" + File.separator + fileName; > + zi_dir = homeDir + File.separator + "lib" + File.separator > + + "zi"; > + } > + final String fname = zi_dir + File.separator + fileName; > buffer = (byte[]) AccessController.doPrivileged(new PrivilegedExceptionAction() { > public Object run() throws IOException { > File file = new File(fname); From keiths at redhat.com Wed Aug 15 09:52:30 2007 From: keiths at redhat.com (Keith Seitz) Date: Wed, 15 Aug 2007 09:52:30 -0700 Subject: Using system tzdata In-Reply-To: <200708090008.l7908GHP025455@ribbit.SFBay.Sun.COM> References: <200708090008.l7908GHP025455@ribbit.SFBay.Sun.COM> Message-ID: <46C32F4E.1050006@redhat.com> Ping? Iris Garcia wrote: > Hi, Keith. > > The timezone information files are owned by the i18n team > (i18n-dev at openjdk.java.net). They should be able to provide you with > guidance. > > Thanks, > iris > >> Date: Wed, 08 Aug 2007 12:40:08 -0700 >> From: Keith Seitz >> Subject: Using system tzdata >> >> Hi, >> >> The JRE contains pre-compiled timezone information files. As an OS >> vendor, Red Hat would prefer not to respin or repackage the JRE every >> time tzdata changes somewhere in the world. >> >> In order to facilitate this, we're in the process of modifying our >> tzdata package to include pre-compiled zoneinfo files for use with JREs. >> I have created a patch to the openjdk JRE that would optionally use >> these files instead of the pre-packaged ones in the JRE. >> >> We would really like to solicit advice/comments about how to get >> something like this accepted upstream so that other distros can use this. >> >> Keith >> >> >> --- openjdk/hotspot/src/os/linux/vm/os_linux.cpp.keiths 2007-08-01 10:21:19.000000000 -0700 >> +++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2007-08-01 10:21:36.000000000 -0700 >> @@ -376,6 +376,10 @@ >> } >> } >> >> + // Use the system zoneinfo files, if present >> + SystemProperty* sp = Arguments::system_properties(); >> + Arguments::PropertyList_add (&sp, >> + "java.zoneinfo.dir", "/usr/share/zoneinfo/java"); >> #undef malloc >> #undef getenv >> #undef EXTENSIONS_DIR >> --- openjdk/j2se/src/share/classes/sun/util/calendar/ZoneInfoFile.java.keiths 2007-08-01 12:31:03.000000000 -0700 >> +++ openjdk/j2se/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2007-08-01 12:29:44.000000000 -0700 >> @@ -1021,10 +1021,18 @@ >> byte[] buffer = null; >> >> try { >> - String homeDir = (String) AccessController.doPrivileged( >> + String zi_dir = (String) AccessController.doPrivileged( >> + new sun.security.action.GetPropertyAction("java.zoneinfo.dir")); >> + File dir = null; >> + if (zi_dir != null) >> + dir = new File(zi_dir); >> + if (dir == null || !dir.exists() || !dir.isDirectory()) { >> + String homeDir = (String) AccessController.doPrivileged( >> new sun.security.action.GetPropertyAction("java.home")); >> - final String fname = homeDir + File.separator + "lib" + File.separator >> - + "zi" + File.separator + fileName; >> + zi_dir = homeDir + File.separator + "lib" + File.separator >> + + "zi"; >> + } >> + final String fname = zi_dir + File.separator + fileName; >> buffer = (byte[]) AccessController.doPrivileged(new PrivilegedExceptionAction() { >> public Object run() throws IOException { >> File file = new File(fname); From Masayoshi.Okutsu at Sun.COM Wed Aug 15 18:54:01 2007 From: Masayoshi.Okutsu at Sun.COM (Masayoshi Okutsu) Date: Thu, 16 Aug 2007 10:54:01 +0900 Subject: Using system tzdata In-Reply-To: <46C32F4E.1050006@redhat.com> References: <200708090008.l7908GHP025455@ribbit.SFBay.Sun.COM> <46C32F4E.1050006@redhat.com> Message-ID: <46C3AE39.3010200@sun.com> Hi Keith, Sorry for taking time to respond. I've filed an RFE for this request to make sure Sun's JRE supports the same mechanism. Sun's Change Request ID (aka bug ID) is 6593486. I have a few comments on the change. * I think the "java." name space should be avoided for this purpose. "user.timezone.dir" should be OK. * I'd also suggest that "/usr/share/zoneinfo/java" be changed to something like "/usr/share/javazi" because Java runtime may search files under /usr/share/zoneinfo to detect the platform time zone setting. It costs extra to skip all the files under /usr/share/zoneinfo/java if the directory comes before other directories in /usr/share/zoneinfo. Also I think /usr/share/zoneinfo should contain the native Olson time zone data files only. * I'm not sure if the current implementation is robust enough to be able to reject all broken data files. It does check magic numbers, though. You may need extra tests with random directory paths. Or you could add more checking to see if the directory is right, such as existence of the ZoneInfoMappings file. Thanks, -- Masayoshi Okutsu Java Internationalization Sun Microsystems On 8/16/2007 1:52 AM, Keith Seitz wrote: > Ping? > > Iris Garcia wrote: >> Hi, Keith. >> >> The timezone information files are owned by the i18n team >> (i18n-dev at openjdk.java.net). They should be able to provide you with >> guidance. >> >> Thanks, >> iris >> >>> Date: Wed, 08 Aug 2007 12:40:08 -0700 >>> From: Keith Seitz >>> Subject: Using system tzdata >>> >>> Hi, >>> >>> The JRE contains pre-compiled timezone information files. As an OS >>> vendor, Red Hat would prefer not to respin or repackage the JRE every >>> time tzdata changes somewhere in the world. >>> >>> In order to facilitate this, we're in the process of modifying our >>> tzdata package to include pre-compiled zoneinfo files for use with >>> JREs. >>> I have created a patch to the openjdk JRE that would optionally use >>> these files instead of the pre-packaged ones in the JRE. >>> >>> We would really like to solicit advice/comments about how to get >>> something like this accepted upstream so that other distros can use >>> this. >>> >>> Keith >>> >>> >>> --- openjdk/hotspot/src/os/linux/vm/os_linux.cpp.keiths >>> 2007-08-01 10:21:19.000000000 -0700 >>> +++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2007-08-01 >>> 10:21:36.000000000 -0700 >>> @@ -376,6 +376,10 @@ >>> } >>> } >>> >>> + // Use the system zoneinfo files, if present >>> + SystemProperty* sp = Arguments::system_properties(); >>> + Arguments::PropertyList_add (&sp, >>> + "java.zoneinfo.dir", "/usr/share/zoneinfo/java"); >>> #undef malloc >>> #undef getenv >>> #undef EXTENSIONS_DIR >>> --- >>> openjdk/j2se/src/share/classes/sun/util/calendar/ZoneInfoFile.java.keiths >>> 2007-08-01 12:31:03.000000000 -0700 >>> +++ >>> openjdk/j2se/src/share/classes/sun/util/calendar/ZoneInfoFile.java >>> 2007-08-01 12:29:44.000000000 -0700 >>> @@ -1021,10 +1021,18 @@ >>> byte[] buffer = null; >>> >>> try { >>> - String homeDir = (String) AccessController.doPrivileged( >>> + String zi_dir = (String) AccessController.doPrivileged( >>> + new >>> sun.security.action.GetPropertyAction("java.zoneinfo.dir")); >>> + File dir = null; >>> + if (zi_dir != null) >>> + dir = new File(zi_dir); >>> + if (dir == null || !dir.exists() || !dir.isDirectory()) { >>> + String homeDir = (String) AccessController.doPrivileged( >>> new >>> sun.security.action.GetPropertyAction("java.home")); >>> - final String fname = homeDir + File.separator + "lib" + >>> File.separator >>> - + "zi" + File.separator + fileName; >>> + zi_dir = homeDir + File.separator + "lib" + File.separator >>> + + "zi"; >>> + } >>> + final String fname = zi_dir + File.separator + fileName; >>> buffer = (byte[]) AccessController.doPrivileged(new >>> PrivilegedExceptionAction() { >>> public Object run() throws IOException { >>> File file = new File(fname); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/i18n-dev/attachments/20070816/96ad8c9f/attachment.html