1a43ba736SRobert Mustacchi#
2a43ba736SRobert Mustacchi# This file and its contents are supplied under the terms of the
3a43ba736SRobert Mustacchi# Common Development and Distribution License ("CDDL"), version 1.0.
4a43ba736SRobert Mustacchi# You may only use this file in accordance with the terms of version
5a43ba736SRobert Mustacchi# 1.0 of the CDDL.
6a43ba736SRobert Mustacchi#
7a43ba736SRobert Mustacchi# A full copy of the text of the CDDL should have accompanied this
8a43ba736SRobert Mustacchi# source.  A copy of the CDDL is also available via the Internet at
9a43ba736SRobert Mustacchi# http://www.illumos.org/license/CDDL.
10a43ba736SRobert Mustacchi#
11a43ba736SRobert Mustacchi
12a43ba736SRobert Mustacchi#
13a43ba736SRobert Mustacchi# Copyright (c) 2014 Joyent, Inc.  All rights reserved.
1406965442SAndy Fiddaman# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
15a43ba736SRobert Mustacchi#
16a43ba736SRobert Mustacchi
17a43ba736SRobert MustacchiHow to update the TZ database information.
18a43ba736SRobert Mustacchi
19a43ba736SRobert MustacchiWelcome! You've probably heard that some aspect of time has changed and
20a43ba736SRobert Mustacchiyou're wondering what to do. The first thing to do is to grab the latest
21a43ba736SRobert Mustacchiversion of the time database which can currently be found at:
22a43ba736SRobert Mustacchi
23a43ba736SRobert Mustacchihttp://www.iana.org/time-zones
24a43ba736SRobert Mustacchi
25a43ba736SRobert MustacchiYou'll need the data tarball. Most data files are used in the gate
26a43ba736SRobert Mustacchidirectly; however, a few have slightly different names. The following
27a43ba736SRobert Mustacchicommands assume that you're inside of the directory you extracted the
28a43ba736SRobert Mustacchitime zone files.
29a43ba736SRobert Mustacchi
30a43ba736SRobert Mustacchi$ cp africa antarctica asia australasia backward etcetera europe \
31f915e6d3SRobert Mustacchi  northamerica southamerica $CODEMGR_WS/usr/src/data/zoneinfo
32a43ba736SRobert Mustacchi
33a43ba736SRobert MustacchiNext you need to copy the country tab and the zone tab files. These have
34a43ba736SRobert Mustacchidifferent names in our source tree.
35a43ba736SRobert Mustacchi
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
38a43ba736SRobert Mustacchi
39251a62bcSDominik HasslerNow, you need to manually fix up the zone_sun.tab. zone_sun.tab has
40a43ba736SRobert Mustacchiadditional different zone names that the original does not. As things
41a43ba736SRobert Mustacchiare changed and removed, or coordinates updated, the same should be done
42a43ba736SRobert Mustacchiin zone_sun.tab. The simplest way known to deal with it today is
43a43ba736SRobert Mustacchisomething like the following:
44a43ba736SRobert Mustacchi
45503609a9SYuri Pankov$ cd $CODEMGR_WS/usr/src/data/zoneinfo
46a43ba736SRobert Mustacchi$ vimdiff zone.tab.txt zone_sun.tab
47a43ba736SRobert Mustacchi
48a43ba736SRobert MustacchiAnd as you see things that show up as egregiously different, do a 'git
49a43ba736SRobert Mustacchidiff zone.tab.txt' and see what changed and fix zone_sun.tab
50a43ba736SRobert Mustacchiappropriately. Usually this means deleting removed entries and adding
51a43ba736SRobert Mustacchinew ones.
52a43ba736SRobert Mustacchi
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
62a43ba736SRobert MustacchiAfter 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:
67a43ba736SRobert Mustacchi
68f915e6d3SRobert MustacchiLINK	Arda/Beleriand	Arda/Gondolin
69a43ba736SRobert Mustacchi
70f915e6d3SRobert MustacchiThat instructs that Gondolin should be hardlinked to Beleriand. In IPS parlance
71a43ba736SRobert Mustacchithat'd be:
72a43ba736SRobert Mustacchi
7306965442SAndy Fiddamanhardlink path=usr/share/lib/zoneinfo/Arda/Gondolin target=Beleriand
7406965442SAndy Fiddaman
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.
85a43ba736SRobert Mustacchi
86a43ba736SRobert MustacchiOnce both of those are done, you'll need to update the version of the package
87a43ba736SRobert Mustacchiitself in the manifest. IANA releases these as <year><letter>, eg. 2013i.
88a43ba736SRobert MustacchiInstead, you need to encode that letter to its spot in the alphabet. So 2013i
89a43ba736SRobert Mustacchiwould become 2013.9.
90a43ba736SRobert Mustacchi
91a43ba736SRobert MustacchiOnce packaging is all done, then you should be all set.
92