xref: /titanic_53/usr/src/data/zoneinfo/README.illumos (revision 7d2c63f8305d23a81cbff67cf17cb07fe30edb57)
15d0e1406SMarcel Telka#
25d0e1406SMarcel Telka# This file and its contents are supplied under the terms of the
35d0e1406SMarcel Telka# Common Development and Distribution License ("CDDL"), version 1.0.
45d0e1406SMarcel Telka# You may only use this file in accordance with the terms of version
55d0e1406SMarcel Telka# 1.0 of the CDDL.
65d0e1406SMarcel Telka#
75d0e1406SMarcel Telka# A full copy of the text of the CDDL should have accompanied this
85d0e1406SMarcel Telka# source.  A copy of the CDDL is also available via the Internet at
95d0e1406SMarcel Telka# http://www.illumos.org/license/CDDL.
105d0e1406SMarcel Telka#
115d0e1406SMarcel Telka
125d0e1406SMarcel Telka#
135d0e1406SMarcel Telka# Copyright (c) 2014 Joyent, Inc.  All rights reserved.
14*7d2c63f8SAndy Fiddaman# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
155d0e1406SMarcel Telka#
165d0e1406SMarcel Telka
175d0e1406SMarcel TelkaHow to update the TZ database information.
185d0e1406SMarcel Telka
195d0e1406SMarcel TelkaWelcome! You've probably heard that some aspect of time has changed and
205d0e1406SMarcel Telkayou're wondering what to do. The first thing to do is to grab the latest
215d0e1406SMarcel Telkaversion of the time database which can currently be found at:
225d0e1406SMarcel Telka
235d0e1406SMarcel Telkahttp://www.iana.org/time-zones
245d0e1406SMarcel Telka
255d0e1406SMarcel TelkaYou'll need the data tarball. Most data files are used in the gate
265d0e1406SMarcel Telkadirectly; however, a few have slightly different names. The following
275d0e1406SMarcel Telkacommands assume that you're inside of the directory you extracted the
285d0e1406SMarcel Telkatime zone files.
295d0e1406SMarcel Telka
305d0e1406SMarcel Telka$ cp africa antarctica asia australasia backward etcetera europe \
315d0e1406SMarcel Telka  northamerica pacificnew southamerica systemv $CODEMGR_WS/usr/src/data/zoneinfo
325d0e1406SMarcel Telka
335d0e1406SMarcel TelkaNext you need to copy the country tab and the zone tab files. These have
345d0e1406SMarcel Telkadifferent names in our source tree.
355d0e1406SMarcel Telka
365d0e1406SMarcel Telka$ cp iso3166.tab $CODEMGR_WS/usr/src/data/zoneinfo/country.tab
375d0e1406SMarcel Telka$ cp zone.tab $CODEMGR_WS/usr/src/data/zoneinfo/zone.tab.txt
385d0e1406SMarcel Telka
399047ba7fSDominik HasslerNow, you need to manually fix up the zone_sun.tab. zone_sun.tab has
405d0e1406SMarcel Telkaadditional different zone names that the original does not. As things
415d0e1406SMarcel Telkaare changed and removed, or coordinates updated, the same should be done
425d0e1406SMarcel Telkain zone_sun.tab. The simplest way known to deal with it today is
435d0e1406SMarcel Telkasomething like the following:
445d0e1406SMarcel Telka
455d0e1406SMarcel Telka$ cd $CODEMGR_WS/usr/src/data/zoneinfo
465d0e1406SMarcel Telka$ vimdiff zone.tab.txt zone_sun.tab
475d0e1406SMarcel Telka
485d0e1406SMarcel TelkaAnd as you see things that show up as egregiously different, do a 'git
495d0e1406SMarcel Telkadiff zone.tab.txt' and see what changed and fix zone_sun.tab
505d0e1406SMarcel Telkaappropriately. Usually this means deleting removed entries and adding
515d0e1406SMarcel Telkanew ones.
525d0e1406SMarcel Telka
538d161de1SAndy Fiddaman********** IMPORTANT **********
548d161de1SAndy Fiddaman*** zone_sun.tab must remain sorted.
558d161de1SAndy Fiddaman*** The upstream zone.tab.txt is not always completely in alphabetical order.
568d161de1SAndy Fiddaman
57*7d2c63f8SAndy FiddamanTo check the final zone_sun.tab file, the `zonelint` script in the current
58*7d2c63f8SAndy Fiddamandirectory can be used within a bldenv environment. First run `dmake install`
59*7d2c63f8SAndy Fiddamanto stage the zone files to proto, then run `./zonelint`. If it produces no
60*7d2c63f8SAndy Fiddamanoutput then you're okay.
61*7d2c63f8SAndy Fiddaman
625d0e1406SMarcel TelkaAfter that's done, you'll need to go through the more agonizing process of
635d0e1406SMarcel Telkapackaging. To do this, you'll want to look through the differences that have
645d0e1406SMarcel Telkaoccurred in zone.tab.txt and backward. The contents of backward describe
655d0e1406SMarcel Telkahardlinks that need to exist in packaging. Specifically, if you have a line in
665d0e1406SMarcel Telkathe form of:
675d0e1406SMarcel Telka
685d0e1406SMarcel TelkaLINK	Beleriand	Gondolin
695d0e1406SMarcel Telka
705d0e1406SMarcel TelkaThat instructs that Gondolin should be hardlinked to Beleriand. In ips parlance
715d0e1406SMarcel Telkathat'd be:
725d0e1406SMarcel Telka
735d0e1406SMarcel Telkahardlink path=usr/share/lib/zoneinfo/Beleriand target=./Gondolin
745d0e1406SMarcel Telka
755d0e1406SMarcel TelkaThe differences in zone.tab.txt describe the additions and removals of various
765d0e1406SMarcel Telkafile entries. If you're not friends with protocmp yet, this should help you out.
775d0e1406SMarcel TelkaOnce both of those are done, you'll need to update the version of the package
785d0e1406SMarcel Telkaitself in the manifest. IANA releases these as <year><letter>, eg. 2013i.
795d0e1406SMarcel TelkaInstead, you need to encode that letter to its spot in the alphabet. So 2013i
805d0e1406SMarcel Telkawould become 2013.9.
815d0e1406SMarcel Telka
825d0e1406SMarcel TelkaOnce packaging is all done, then you should be all set.
83