2016-07-05 18:16:05 -06:00
|
|
|
#!/bin/bash
|
2016-04-10 15:32:26 -06:00
|
|
|
# Copyright 2012 The Go Authors. All rights reserved.
|
2012-02-18 18:33:58 -07:00
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
# This script rebuilds the time zone files using files
|
|
|
|
# downloaded from the ICANN/IANA distribution.
|
2018-01-23 23:11:51 -07:00
|
|
|
# Consult https://www.iana.org/time-zones for the latest versions.
|
2012-02-18 18:33:58 -07:00
|
|
|
|
|
|
|
# Versions to use.
|
2020-12-23 01:30:22 -07:00
|
|
|
CODE=2020e
|
|
|
|
DATA=2020e
|
2012-02-18 18:33:58 -07:00
|
|
|
|
|
|
|
set -e
|
2012-02-19 01:16:20 -07:00
|
|
|
rm -rf work
|
|
|
|
mkdir work
|
2012-02-18 18:33:58 -07:00
|
|
|
cd work
|
2012-02-19 01:16:20 -07:00
|
|
|
mkdir zoneinfo
|
2018-01-23 23:11:51 -07:00
|
|
|
curl -L -O https://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
|
|
|
|
curl -L -O https://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
|
2012-02-18 18:33:58 -07:00
|
|
|
tar xzf tzcode$CODE.tar.gz
|
|
|
|
tar xzf tzdata$DATA.tar.gz
|
|
|
|
|
2020-10-13 09:07:34 -06:00
|
|
|
make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only
|
2012-02-18 18:33:58 -07:00
|
|
|
|
2012-02-19 01:16:20 -07:00
|
|
|
cd zoneinfo
|
|
|
|
rm -f ../../zoneinfo.zip
|
|
|
|
zip -0 -r ../../zoneinfo.zip *
|
|
|
|
cd ../..
|
|
|
|
|
2020-04-13 17:48:23 -06:00
|
|
|
go generate time/tzdata
|
|
|
|
|
2012-02-18 18:33:58 -07:00
|
|
|
echo
|
2018-01-23 23:11:51 -07:00
|
|
|
if [ "$1" = "-work" ]; then
|
2012-02-18 18:33:58 -07:00
|
|
|
echo Left workspace behind in work/.
|
|
|
|
else
|
|
|
|
rm -rf work
|
|
|
|
fi
|
2012-02-19 01:16:20 -07:00
|
|
|
echo New time zone files in zoneinfo.zip.
|