xref: /titanic_52/usr/src/data/zoneinfo/README.illumos (revision 743cf22567cc013b3c62c1efae0455fa7c838c60)
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*743cf225SAndy Fiddaman# Copyright 2021 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 \
31c5580037SRobert Mustacchi  northamerica southamerica $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
577d2c63f8SAndy FiddamanTo check the final zone_sun.tab file, the `zonelint` script in the current
587d2c63f8SAndy Fiddamandirectory can be used within a bldenv environment. First run `dmake install`
597d2c63f8SAndy Fiddamanto stage the zone files to proto, then run `./zonelint`. If it produces no
607d2c63f8SAndy Fiddamanoutput then you're okay.
617d2c63f8SAndy Fiddaman
625d0e1406SMarcel TelkaAfter that's done, you'll need to go through the more agonizing process of
63*743cf225SAndy Fiddamanpackaging. To do this, you'll want to look through the differences in "Link"
64*743cf225SAndy Fiddamanlines in all files under $CODEMGR_WS/usr/src/data/zoneinfo/
65*743cf225SAndy FiddamanThese "Link" lines describe hardlinks that need to exist in packaging.
66*743cf225SAndy FiddamanSpecifically, if you have a line in the form of:
675d0e1406SMarcel Telka
68c5580037SRobert MustacchiLINK	Arda/Beleriand	Arda/Gondolin
695d0e1406SMarcel Telka
70c5580037SRobert MustacchiThat instructs that Gondolin should be hardlinked to Beleriand. In IPS parlance
715d0e1406SMarcel Telkathat'd be:
725d0e1406SMarcel Telka
73*743cf225SAndy Fiddamanhardlink path=usr/share/lib/zoneinfo/Arda/Gondolin target=Beleriand
745d0e1406SMarcel Telka
75*743cf225SAndy FiddamanThe 'update' make target can help with this by automatically re-generating all
76*743cf225SAndy Fiddamanof the hardlinks in the package manifest based on the Link lines found in the
77*743cf225SAndy Fiddamandata files. Run 'make update' and then check the manifest file at
78*743cf225SAndy Fiddaman$CODEMGR_WS/usr/src/pkg/manifests/system-data-zoneinfo.mf to ensure it has
79*743cf225SAndy Fiddamandone the right thing.
80*743cf225SAndy Fiddaman
81*743cf225SAndy FiddamanOther differences in files describe the addition and removal of various
82*743cf225SAndy Fiddamanfile entries. The update_manifest script will take care of files which have
83*743cf225SAndy Fiddamanchanged to links but others may need manual adjustment. If you're not friends
84*743cf225SAndy Fiddamanwith protocmp yet, this should help you out.
85*743cf225SAndy Fiddaman
865d0e1406SMarcel TelkaOnce both of those are done, you'll need to update the version of the package
875d0e1406SMarcel Telkaitself in the manifest. IANA releases these as <year><letter>, eg. 2013i.
885d0e1406SMarcel TelkaInstead, you need to encode that letter to its spot in the alphabet. So 2013i
895d0e1406SMarcel Telkawould become 2013.9.
905d0e1406SMarcel Telka
915d0e1406SMarcel TelkaOnce packaging is all done, then you should be all set.
92