xref: /illumos-gate/usr/src/data/zoneinfo/README.illumos (revision 25b05a3ecbac136f5e1192d4d9e79dc14f895785)
1503609a9SYuri Pankov#
2503609a9SYuri Pankov# This file and its contents are supplied under the terms of the
3503609a9SYuri Pankov# Common Development and Distribution License ("CDDL"), version 1.0.
4503609a9SYuri Pankov# You may only use this file in accordance with the terms of version
5503609a9SYuri Pankov# 1.0 of the CDDL.
6503609a9SYuri Pankov#
7503609a9SYuri Pankov# A full copy of the text of the CDDL should have accompanied this
8503609a9SYuri Pankov# source.  A copy of the CDDL is also available via the Internet at
9503609a9SYuri Pankov# http://www.illumos.org/license/CDDL.
10503609a9SYuri Pankov#
11503609a9SYuri Pankov
12503609a9SYuri Pankov#
13503609a9SYuri Pankov# Copyright (c) 2014 Joyent, Inc.  All rights reserved.
1406965442SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
15503609a9SYuri Pankov#
16503609a9SYuri Pankov
17503609a9SYuri PankovHow to update the TZ database information.
18503609a9SYuri Pankov
19503609a9SYuri PankovWelcome! You've probably heard that some aspect of time has changed and
20503609a9SYuri Pankovyou're wondering what to do. The first thing to do is to grab the latest
21503609a9SYuri Pankovversion of the time database which can currently be found at:
22503609a9SYuri Pankov
23503609a9SYuri Pankovhttp://www.iana.org/time-zones
24503609a9SYuri Pankov
25503609a9SYuri PankovYou'll need the data tarball. Most data files are used in the gate
26503609a9SYuri Pankovdirectly; however, a few have slightly different names. The following
27503609a9SYuri Pankovcommands assume that you're inside of the directory you extracted the
28503609a9SYuri Pankovtime zone files.
29503609a9SYuri Pankov
30503609a9SYuri Pankov$ cp africa antarctica asia australasia backward etcetera europe \
31f915e6d3SRobert Mustacchi  northamerica southamerica $CODEMGR_WS/usr/src/data/zoneinfo
32503609a9SYuri Pankov
33503609a9SYuri PankovNext you need to copy the country tab and the zone tab files. These have
34503609a9SYuri Pankovdifferent names in our source tree.
35503609a9SYuri Pankov
36503609a9SYuri Pankov$ cp iso3166.tab $CODEMGR_WS/usr/src/data/zoneinfo/country.tab
37503609a9SYuri Pankov$ cp zone.tab $CODEMGR_WS/usr/src/data/zoneinfo/zone.tab.txt
38503609a9SYuri Pankov
39251a62bcSDominik HasslerNow, you need to manually fix up the zone_sun.tab. zone_sun.tab has
40503609a9SYuri Pankovadditional different zone names that the original does not. As things
41503609a9SYuri Pankovare changed and removed, or coordinates updated, the same should be done
42503609a9SYuri Pankovin zone_sun.tab. The simplest way known to deal with it today is
43503609a9SYuri Pankovsomething like the following:
44503609a9SYuri Pankov
45503609a9SYuri Pankov$ cd $CODEMGR_WS/usr/src/data/zoneinfo
46503609a9SYuri Pankov$ vimdiff zone.tab.txt zone_sun.tab
47503609a9SYuri Pankov
48503609a9SYuri PankovAnd as you see things that show up as egregiously different, do a 'git
49503609a9SYuri Pankovdiff zone.tab.txt' and see what changed and fix zone_sun.tab
50503609a9SYuri Pankovappropriately. Usually this means deleting removed entries and adding
51503609a9SYuri Pankovnew ones.
52503609a9SYuri Pankov
534cfdb466SAndy Fiddaman********** IMPORTANT **********
544cfdb466SAndy Fiddaman*** zone_sun.tab must remain sorted.
554cfdb466SAndy Fiddaman*** The upstream zone.tab.txt is not always completely in alphabetical order.
564cfdb466SAndy Fiddaman
5763878f74SAndy FiddamanTo check the final zone_sun.tab file, the `zonelint` script in the current
5863878f74SAndy Fiddamandirectory can be used within a bldenv environment. First run `dmake install`
5963878f74SAndy Fiddamanto stage the zone files to proto, then run `./zonelint`. If it produces no
6063878f74SAndy Fiddamanoutput then you're okay.
6163878f74SAndy Fiddaman
62503609a9SYuri PankovAfter that's done, you'll need to go through the more agonizing process of
6306965442SAndy Fiddamanpackaging. To do this, you'll want to look through the differences in "Link"
6406965442SAndy Fiddamanlines in all files under $CODEMGR_WS/usr/src/data/zoneinfo/
6506965442SAndy FiddamanThese "Link" lines describe hardlinks that need to exist in packaging.
6606965442SAndy FiddamanSpecifically, if you have a line in the form of:
67503609a9SYuri Pankov
68f915e6d3SRobert MustacchiLINK	Arda/Beleriand	Arda/Gondolin
69503609a9SYuri Pankov
70f915e6d3SRobert MustacchiThat instructs that Gondolin should be hardlinked to Beleriand. In IPS parlance
71503609a9SYuri Pankovthat'd be:
72503609a9SYuri Pankov
7306965442SAndy Fiddamanhardlink path=usr/share/lib/zoneinfo/Arda/Gondolin target=Beleriand
74503609a9SYuri Pankov
7506965442SAndy FiddamanThe 'update' make target can help with this by automatically re-generating all
7606965442SAndy Fiddamanof the hardlinks in the package manifest based on the Link lines found in the
7706965442SAndy Fiddamandata files. Run 'make update' and then check the manifest file at
78*25b05a3eSAndy Fiddaman$CODEMGR_WS/usr/src/pkg/manifests/system-data-zoneinfo.p5m to ensure it has
7906965442SAndy Fiddamandone the right thing.
8006965442SAndy Fiddaman
8106965442SAndy FiddamanOther differences in files describe the addition and removal of various
8206965442SAndy Fiddamanfile entries. The update_manifest script will take care of files which have
8306965442SAndy Fiddamanchanged to links but others may need manual adjustment. If you're not friends
8406965442SAndy Fiddamanwith protocmp yet, this should help you out.
8506965442SAndy Fiddaman
86503609a9SYuri PankovOnce both of those are done, you'll need to update the version of the package
87503609a9SYuri Pankovitself in the manifest. IANA releases these as <year><letter>, eg. 2013i.
88503609a9SYuri PankovInstead, you need to encode that letter to its spot in the alphabet. So 2013i
89503609a9SYuri Pankovwould become 2013.9.
90503609a9SYuri Pankov
91503609a9SYuri PankovOnce packaging is all done, then you should be all set.
92