I've updated my system zoneinfo manually. It has turned out to be rather simple—assuming I got it right. Here's what I did:
1. Download and extract the newly-released zoneinfo distribution:
wget ftp://ftp.iana.org/tz/tzdata-latest.tar.gz
tar -xvzf tzdata-latest.tar.gz
The distributed tar file contains no directories, so extract this somewhere you won't make a mess.
2. Check for certain possibly-missing country codes:
FreeBSD has a file named
/usr/share/misc/iso3166 that contains the two-letter country codes. Certain of the country codes used by the zoneinfo database could be missing from that file, and if so ought to be removed from the distributed
zone.tab file downloaded in step 1. To do this, first grep the
iso3166 file for each, and then comment out the lines for any the missing countries from the
zone.tab file:
for m in AX BL BQ CW GG IM JE ME MF RS SS SX
do echo -n $m:
grep -c ^$m /usr/share/misc/iso3166
done
Look for any zeroes; a zero indicates the associated country-code is missing. If any code is missing, then find it in
zone.tab and comment it out. None of these was missing from my
iso3166 file (FreeBSD 10.1-RELEASE).
3. Compile the timezones using zic:
mkdir zoneinfo
zic -d zoneinfo -p America/New_York -m 444 -L leapseconds -y yearistype.sh \
africa antarctica asia australasia etcetera europe \
factory northamerica southamerica systemv
See the
zic manual page for an explanation of the
-p option, and set it appropriately for your machine.
The default behavior of the
zic utility (without the
-d option) is to install the compiled files into
/usr/share/zoneinfo, but here I created a staging directory named
zoneinfo in order that I could be sure the compilation had completed before deinstalling the currently-installed port.
Note: I got a warning about non-POSIX format abbreviation in the
factory file, which I ignored.
4. Install the compiled files:
At this point the compiled files are in the directory named
zoneinfo. Now install these files, and also the
zone.tab file that came with the distribution. First deinstall the
zoneinfo port if necessary (not shown).
cp zone.tab zoneinfo
cp -R zoneinfo /usr/share
5. Finally, reinstall the system default timezone file:
tzsetup -r
And that's it. One thing I am still confused about is that after deinstalling the port, I still had a copy of the
UTC file in
/usr/share/zoneinfo. I deleted that and replaced in with a copy of the
UTC file that the above procedure installed into
/usr/share/zoneinfo/Etc, but I don't know if that helped (nor hurt).
This procedure only addresses the out-of-date
misc/zoneinfo port. I still have not dealt with the also out-of-date
java/java-zoneinfo port. If I figure that out I'll post my conclusions, but I would still appreciate any assistance on that matter.
--
Adam Mackler