]> Cypherpunks.ru repositories - gostls13.git/blob - lib/time/update.bash
lib/time, time/tzdata: update tz data to 2020a
[gostls13.git] / lib / time / update.bash
1 #!/bin/bash
2 # Copyright 2012 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file.
5
6 # This script rebuilds the time zone files using files
7 # downloaded from the ICANN/IANA distribution.
8 # Consult https://www.iana.org/time-zones for the latest versions.
9
10 # Versions to use.
11 CODE=2020a
12 DATA=2020a
13
14 set -e
15 rm -rf work
16 mkdir work
17 cd work
18 mkdir zoneinfo
19 curl -L -O https://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
20 curl -L -O https://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
21 tar xzf tzcode$CODE.tar.gz
22 tar xzf tzdata$DATA.tar.gz
23
24 make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only
25
26 cd zoneinfo
27 rm -f ../../zoneinfo.zip
28 zip -0 -r ../../zoneinfo.zip *
29 cd ../..
30
31 go generate time/tzdata
32
33 echo
34 if [ "$1" = "-work" ]; then
35         echo Left workspace behind in work/.
36 else
37         rm -rf work
38 fi
39 echo New time zone files in zoneinfo.zip.