| 
									
										
										
										
											2016-07-06 00:16:05 +00:00
										 |  |  | #!/bin/bash
 | 
					
						
							| 
									
										
										
										
											2016-04-10 14:32:26 -07:00
										 |  |  | # Copyright 2012 The Go Authors. All rights reserved. | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05: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 22:11:51 -08:00
										 |  |  | # Consult https://www.iana.org/time-zones for the latest versions. | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Versions to use. | 
					
						
							| 
									
										
										
										
											2021-01-25 12:31:54 +01:00
										 |  |  | CODE=2021a | 
					
						
							|  |  |  | DATA=2021a | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | set -e | 
					
						
							| 
									
										
										
										
											2012-02-19 03:16:20 -05:00
										 |  |  | rm -rf work | 
					
						
							|  |  |  | mkdir work | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05:00
										 |  |  | cd work | 
					
						
							| 
									
										
										
										
											2012-02-19 03:16:20 -05:00
										 |  |  | mkdir zoneinfo | 
					
						
							| 
									
										
										
										
											2018-01-23 22:11:51 -08: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 20:33:58 -05:00
										 |  |  | tar xzf tzcode$CODE.tar.gz | 
					
						
							|  |  |  | tar xzf tzdata$DATA.tar.gz | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-13 17:07:34 +02:00
										 |  |  | make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-19 03:16:20 -05:00
										 |  |  | cd zoneinfo | 
					
						
							|  |  |  | rm -f ../../zoneinfo.zip | 
					
						
							|  |  |  | zip -0 -r ../../zoneinfo.zip * | 
					
						
							|  |  |  | cd ../.. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-13 16:48:23 -07:00
										 |  |  | go generate time/tzdata | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05:00
										 |  |  | echo | 
					
						
							| 
									
										
										
										
											2018-01-23 22:11:51 -08:00
										 |  |  | if [ "$1" = "-work" ]; then | 
					
						
							| 
									
										
										
										
											2012-02-18 20:33:58 -05:00
										 |  |  | 	echo Left workspace behind in work/. | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  | 	rm -rf work | 
					
						
							|  |  |  | fi | 
					
						
							| 
									
										
										
										
											2012-02-19 03:16:20 -05:00
										 |  |  | echo New time zone files in zoneinfo.zip. |