Commit e2e2d10b authored by Alex Brainman's avatar Alex Brainman

time: always use $GOROOT/lib/time/zoneinfo.zip with genzabbrs.go

genzabbrs.go uses whatever zoneinfo database available on the system.
This makes genzabbrs.go output change from system to system. Adjust
go:generate line to always use $GOROOT/lib/time/zoneinfo.zip, so it
does not matter who runs the command.

Also move go:generate line into zoneinfo.go, so it can be run
on Unix (see #16368 for details).

Fixes #15802.

Change-Id: I8ae4818aaf40795364e180d7bb4326ad7c07c370
Reviewed-on: https://go-review.googlesource.com/27832Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 90c3cf4b
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"syscall" "syscall"
) )
//go:generate env ZONEINFO=$GOROOT/lib/time/zoneinfo.zip go run genzabbrs.go -output zoneinfo_abbrs_windows.go
// A Location maps time instants to the zone in use at that time. // A Location maps time instants to the zone in use at that time.
// Typically, the Location represents the collection of time offsets // Typically, the Location represents the collection of time offsets
// in use in a geographical area, such as CEST and CET for central Europe. // in use in a geographical area, such as CEST and CET for central Europe.
......
...@@ -20,7 +20,9 @@ var abbrs = map[string]abbr{ ...@@ -20,7 +20,9 @@ var abbrs = map[string]abbr{
"E. Africa Standard Time": {"EAT", "EAT"}, // Africa/Nairobi "E. Africa Standard Time": {"EAT", "EAT"}, // Africa/Nairobi
"Libya Standard Time": {"EET", "EET"}, // Africa/Tripoli "Libya Standard Time": {"EET", "EET"}, // Africa/Tripoli
"Namibia Standard Time": {"WAT", "WAST"}, // Africa/Windhoek "Namibia Standard Time": {"WAT", "WAST"}, // Africa/Windhoek
"Aleutian Standard Time": {"HST", "HDT"}, // America/Adak
"Alaskan Standard Time": {"AKST", "AKDT"}, // America/Anchorage "Alaskan Standard Time": {"AKST", "AKDT"}, // America/Anchorage
"Tocantins Standard Time": {"BRT", "BRT"}, // America/Araguaina
"Paraguay Standard Time": {"PYT", "PYST"}, // America/Asuncion "Paraguay Standard Time": {"PYT", "PYST"}, // America/Asuncion
"Bahia Standard Time": {"BRT", "BRT"}, // America/Bahia "Bahia Standard Time": {"BRT", "BRT"}, // America/Bahia
"SA Pacific Standard Time": {"COT", "COT"}, // America/Bogota "SA Pacific Standard Time": {"COT", "COT"}, // America/Bogota
...@@ -33,19 +35,24 @@ var abbrs = map[string]abbr{ ...@@ -33,19 +35,24 @@ var abbrs = map[string]abbr{
"Central Brazilian Standard Time": {"AMT", "AMST"}, // America/Cuiaba "Central Brazilian Standard Time": {"AMT", "AMST"}, // America/Cuiaba
"Mountain Standard Time": {"MST", "MDT"}, // America/Denver "Mountain Standard Time": {"MST", "MDT"}, // America/Denver
"Greenland Standard Time": {"WGT", "WGST"}, // America/Godthab "Greenland Standard Time": {"WGT", "WGST"}, // America/Godthab
"Turks And Caicos Standard Time": {"AST", "AST"}, // America/Grand_Turk
"Central America Standard Time": {"CST", "CST"}, // America/Guatemala "Central America Standard Time": {"CST", "CST"}, // America/Guatemala
"Atlantic Standard Time": {"AST", "ADT"}, // America/Halifax "Atlantic Standard Time": {"AST", "ADT"}, // America/Halifax
"Cuba Standard Time": {"CST", "CDT"}, // America/Havana
"US Eastern Standard Time": {"EST", "EDT"}, // America/Indianapolis "US Eastern Standard Time": {"EST", "EDT"}, // America/Indianapolis
"SA Western Standard Time": {"BOT", "BOT"}, // America/La_Paz "SA Western Standard Time": {"BOT", "BOT"}, // America/La_Paz
"Pacific Standard Time": {"PST", "PDT"}, // America/Los_Angeles "Pacific Standard Time": {"PST", "PDT"}, // America/Los_Angeles
"Central Standard Time (Mexico)": {"CST", "CDT"}, // America/Mexico_City "Central Standard Time (Mexico)": {"CST", "CDT"}, // America/Mexico_City
"Saint Pierre Standard Time": {"PMST", "PMDT"}, // America/Miquelon
"Montevideo Standard Time": {"UYT", "UYT"}, // America/Montevideo "Montevideo Standard Time": {"UYT", "UYT"}, // America/Montevideo
"Eastern Standard Time": {"EST", "EDT"}, // America/New_York "Eastern Standard Time": {"EST", "EDT"}, // America/New_York
"US Mountain Standard Time": {"MST", "MST"}, // America/Phoenix "US Mountain Standard Time": {"MST", "MST"}, // America/Phoenix
"Haiti Standard Time": {"EST", "EST"}, // America/Port-au-Prince
"Canada Central Standard Time": {"CST", "CST"}, // America/Regina "Canada Central Standard Time": {"CST", "CST"}, // America/Regina
"Pacific SA Standard Time": {"CLT", "CLST"}, // America/Santiago "Pacific SA Standard Time": {"CLT", "CLST"}, // America/Santiago
"E. South America Standard Time": {"BRT", "BRST"}, // America/Sao_Paulo "E. South America Standard Time": {"BRT", "BRST"}, // America/Sao_Paulo
"Newfoundland Standard Time": {"NST", "NDT"}, // America/St_Johns "Newfoundland Standard Time": {"NST", "NDT"}, // America/St_Johns
"Pacific Standard Time (Mexico)": {"PST", "PDT"}, // America/Tijuana
"Central Asia Standard Time": {"+06", "+06"}, // Asia/Almaty "Central Asia Standard Time": {"+06", "+06"}, // Asia/Almaty
"Jordan Standard Time": {"EET", "EEST"}, // Asia/Amman "Jordan Standard Time": {"EET", "EEST"}, // Asia/Amman
"Arabic Standard Time": {"AST", "AST"}, // Asia/Baghdad "Arabic Standard Time": {"AST", "AST"}, // Asia/Baghdad
...@@ -59,6 +66,8 @@ var abbrs = map[string]abbr{ ...@@ -59,6 +66,8 @@ var abbrs = map[string]abbr{
"Syria Standard Time": {"EET", "EEST"}, // Asia/Damascus "Syria Standard Time": {"EET", "EEST"}, // Asia/Damascus
"Bangladesh Standard Time": {"BDT", "BDT"}, // Asia/Dhaka "Bangladesh Standard Time": {"BDT", "BDT"}, // Asia/Dhaka
"Arabian Standard Time": {"GST", "GST"}, // Asia/Dubai "Arabian Standard Time": {"GST", "GST"}, // Asia/Dubai
"West Bank Standard Time": {"EET", "EEST"}, // Asia/Hebron
"W. Mongolia Standard Time": {"HOVT", "HOVST"}, // Asia/Hovd
"North Asia East Standard Time": {"IRKT", "IRKT"}, // Asia/Irkutsk "North Asia East Standard Time": {"IRKT", "IRKT"}, // Asia/Irkutsk
"Israel Standard Time": {"IST", "IDT"}, // Asia/Jerusalem "Israel Standard Time": {"IST", "IDT"}, // Asia/Jerusalem
"Afghanistan Standard Time": {"AFT", "AFT"}, // Asia/Kabul "Afghanistan Standard Time": {"AFT", "AFT"}, // Asia/Kabul
...@@ -67,7 +76,7 @@ var abbrs = map[string]abbr{ ...@@ -67,7 +76,7 @@ var abbrs = map[string]abbr{
"Nepal Standard Time": {"NPT", "NPT"}, // Asia/Katmandu "Nepal Standard Time": {"NPT", "NPT"}, // Asia/Katmandu
"North Asia Standard Time": {"KRAT", "KRAT"}, // Asia/Krasnoyarsk "North Asia Standard Time": {"KRAT", "KRAT"}, // Asia/Krasnoyarsk
"Magadan Standard Time": {"MAGT", "MAGT"}, // Asia/Magadan "Magadan Standard Time": {"MAGT", "MAGT"}, // Asia/Magadan
"N. Central Asia Standard Time": {"NOVT", "NOVT"}, // Asia/Novosibirsk "N. Central Asia Standard Time": {"+06", "+07"}, // Asia/Novosibirsk
"North Korea Standard Time": {"KST", "KST"}, // Asia/Pyongyang "North Korea Standard Time": {"KST", "KST"}, // Asia/Pyongyang
"Myanmar Standard Time": {"MMT", "MMT"}, // Asia/Rangoon "Myanmar Standard Time": {"MMT", "MMT"}, // Asia/Rangoon
"Arab Standard Time": {"AST", "AST"}, // Asia/Riyadh "Arab Standard Time": {"AST", "AST"}, // Asia/Riyadh
...@@ -81,6 +90,7 @@ var abbrs = map[string]abbr{ ...@@ -81,6 +90,7 @@ var abbrs = map[string]abbr{
"Georgian Standard Time": {"GET", "GET"}, // Asia/Tbilisi "Georgian Standard Time": {"GET", "GET"}, // Asia/Tbilisi
"Iran Standard Time": {"IRST", "IRDT"}, // Asia/Tehran "Iran Standard Time": {"IRST", "IRDT"}, // Asia/Tehran
"Tokyo Standard Time": {"JST", "JST"}, // Asia/Tokyo "Tokyo Standard Time": {"JST", "JST"}, // Asia/Tokyo
"Tomsk Standard Time": {"+06", "+07"}, // Asia/Tomsk
"Ulaanbaatar Standard Time": {"ULAT", "ULAST"}, // Asia/Ulaanbaatar "Ulaanbaatar Standard Time": {"ULAT", "ULAST"}, // Asia/Ulaanbaatar
"Vladivostok Standard Time": {"VLAT", "VLAT"}, // Asia/Vladivostok "Vladivostok Standard Time": {"VLAT", "VLAT"}, // Asia/Vladivostok
"Yakutsk Standard Time": {"YAKT", "YAKT"}, // Asia/Yakutsk "Yakutsk Standard Time": {"YAKT", "YAKT"}, // Asia/Yakutsk
...@@ -92,13 +102,17 @@ var abbrs = map[string]abbr{ ...@@ -92,13 +102,17 @@ var abbrs = map[string]abbr{
"Cen. Australia Standard Time": {"ACST", "ACDT"}, // Australia/Adelaide "Cen. Australia Standard Time": {"ACST", "ACDT"}, // Australia/Adelaide
"E. Australia Standard Time": {"AEST", "AEST"}, // Australia/Brisbane "E. Australia Standard Time": {"AEST", "AEST"}, // Australia/Brisbane
"AUS Central Standard Time": {"ACST", "ACST"}, // Australia/Darwin "AUS Central Standard Time": {"ACST", "ACST"}, // Australia/Darwin
"Aus Central W. Standard Time": {"ACWST", "ACWST"}, // Australia/Eucla
"Tasmania Standard Time": {"AEST", "AEDT"}, // Australia/Hobart "Tasmania Standard Time": {"AEST", "AEDT"}, // Australia/Hobart
"Lord Howe Standard Time": {"LHST", "LHDT"}, // Australia/Lord_Howe
"W. Australia Standard Time": {"AWST", "AWST"}, // Australia/Perth "W. Australia Standard Time": {"AWST", "AWST"}, // Australia/Perth
"AUS Eastern Standard Time": {"AEST", "AEDT"}, // Australia/Sydney "AUS Eastern Standard Time": {"AEST", "AEDT"}, // Australia/Sydney
"UTC": {"GMT", "GMT"}, // Etc/GMT "UTC": {"GMT", "GMT"}, // Etc/GMT
"UTC-11": {"GMT+11", "GMT+11"}, // Etc/GMT+11 "UTC-11": {"GMT+11", "GMT+11"}, // Etc/GMT+11
"Dateline Standard Time": {"GMT+12", "GMT+12"}, // Etc/GMT+12 "Dateline Standard Time": {"GMT+12", "GMT+12"}, // Etc/GMT+12
"UTC-02": {"GMT+2", "GMT+2"}, // Etc/GMT+2 "UTC-02": {"GMT+2", "GMT+2"}, // Etc/GMT+2
"UTC-08": {"GMT+8", "GMT+8"}, // Etc/GMT+8
"UTC-09": {"GMT+9", "GMT+9"}, // Etc/GMT+9
"UTC+12": {"GMT-12", "GMT-12"}, // Etc/GMT-12 "UTC+12": {"GMT-12", "GMT-12"}, // Etc/GMT-12
"Astrakhan Standard Time": {"+03", "+04"}, // Europe/Astrakhan "Astrakhan Standard Time": {"+03", "+04"}, // Europe/Astrakhan
"W. Europe Standard Time": {"CET", "CEST"}, // Europe/Berlin "W. Europe Standard Time": {"CET", "CEST"}, // Europe/Berlin
...@@ -117,10 +131,15 @@ var abbrs = map[string]abbr{ ...@@ -117,10 +131,15 @@ var abbrs = map[string]abbr{
"Mauritius Standard Time": {"MUT", "MUT"}, // Indian/Mauritius "Mauritius Standard Time": {"MUT", "MUT"}, // Indian/Mauritius
"Samoa Standard Time": {"WSST", "WSDT"}, // Pacific/Apia "Samoa Standard Time": {"WSST", "WSDT"}, // Pacific/Apia
"New Zealand Standard Time": {"NZST", "NZDT"}, // Pacific/Auckland "New Zealand Standard Time": {"NZST", "NZDT"}, // Pacific/Auckland
"Bougainville Standard Time": {"BST", "BST"}, // Pacific/Bougainville
"Chatham Islands Standard Time": {"CHAST", "CHADT"}, // Pacific/Chatham
"Easter Island Standard Time": {"EAST", "EASST"}, // Pacific/Easter
"Fiji Standard Time": {"FJT", "FJST"}, // Pacific/Fiji "Fiji Standard Time": {"FJT", "FJST"}, // Pacific/Fiji
"Central Pacific Standard Time": {"SBT", "SBT"}, // Pacific/Guadalcanal "Central Pacific Standard Time": {"SBT", "SBT"}, // Pacific/Guadalcanal
"Hawaiian Standard Time": {"HST", "HST"}, // Pacific/Honolulu "Hawaiian Standard Time": {"HST", "HST"}, // Pacific/Honolulu
"Line Islands Standard Time": {"LINT", "LINT"}, // Pacific/Kiritimati "Line Islands Standard Time": {"LINT", "LINT"}, // Pacific/Kiritimati
"Marquesas Standard Time": {"MART", "MART"}, // Pacific/Marquesas
"Norfolk Standard Time": {"NFT", "NFT"}, // Pacific/Norfolk
"West Pacific Standard Time": {"PGT", "PGT"}, // Pacific/Port_Moresby "West Pacific Standard Time": {"PGT", "PGT"}, // Pacific/Port_Moresby
"Tonga Standard Time": {"TOT", "TOT"}, // Pacific/Tongatapu "Tonga Standard Time": {"TOT", "TOT"}, // Pacific/Tongatapu
} }
...@@ -11,8 +11,6 @@ import ( ...@@ -11,8 +11,6 @@ import (
"syscall" "syscall"
) )
//go:generate go run genzabbrs.go -output zoneinfo_abbrs_windows.go
// TODO(rsc): Fall back to copy of zoneinfo files. // TODO(rsc): Fall back to copy of zoneinfo files.
// BUG(brainman,rsc): On Windows, the operating system does not provide complete // BUG(brainman,rsc): On Windows, the operating system does not provide complete
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment