Alternative path to tzdb.dat

Andrew Hughes gnu.andrew at redhat.com
Sat Sep 30 18:41:34 UTC 2017


On 28 September 2017 at 18:12, Fridrich Strba <fridrich.strba at suse.com> wrote:
> Hello, good people,
>
> For whom it might be interesting, I patched the
> sun/util/calendar/ZoneInfoFile.java so that one can specify in
> tz.properties an alternative directory for tzdb.dat with the
> $JAVA_HOME/jre/lib/ being the fallback whenever the
> $JAVA_HOME/jre/lib/tz.properties is not there or the tzdb.dat is not in
> the directory specified.
>
> I tested the patch with different cases where tzdb.dat was in the
> default position and not in the alternative one, with the opposite, with
> the absence of both (where it failed correctly) with different
> directories in tz.properties.... It works well for me. This allows me
> here not to have to play with symlinks in the post-install phase and
> eventually have a non-working java if the position of the system-wide
> tzdb.dat changes.
>
> The attached patch applies also quite well to jdk9 where I am testing
> the same change right now.
>
> Needless to say, I heavily inspired myself by the patch by Andrew in
> icedtea7 and just adapted it to the code in jdk8 and the changed APIs.
>
> For those that could be interested, that is. And also that it does not
> sit on my disk only
>
> Cheers
>
> Fridrich


We did try to get the original patch upstream some time ago, but they
were reluctant to accept such a change if a symlink would do. We could
try again though.

The only thing I note about the patch is that you retrieve homeDir via
a doPrivileged call, when you're already inside a doPrivileged block.
Was this intentional?

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Web Site: http://fuseyism.com
Twitter: https://twitter.com/gnu_andrew_java
PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the distro-pkg-dev mailing list