From: Yoshito Umaoka Date: Wed, 24 Jan 2018 01:37:07 +0000 (+0000) Subject: ICU-13552 tzdata2018b updates to ICU trunk. Also fixed a few issues in the test code... X-Git-Tag: release-61-rc~144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a222a6fa254c2b57ab028ba984608eeef9b62456;p=icu ICU-13552 tzdata2018b updates to ICU trunk. Also fixed a few issues in the test code and script. tz2icu was also updated to support customized Links for ICU overide zones. X-SVN-Rev: 40794 --- diff --git a/icu4c/source/data/misc/zoneinfo64.txt b/icu4c/source/data/misc/zoneinfo64.txt index f4ece0a8ac6..c64e2f1473a 100644 --- a/icu4c/source/data/misc/zoneinfo64.txt +++ b/icu4c/source/data/misc/zoneinfo64.txt @@ -3,9 +3,9 @@ // License & terms of use: http://www.unicode.org/copyright.html#License //--------------------------------------------------------- // Build tool: tz2icu -// Build date: Thu Jan 18 04:48:22 2018 +// Build date: Tue Jan 23 18:02:21 2018 // tz database: ftp://ftp.iana.org/tz/ -// tz version: 2018a +// tz version: 2018b // ICU version: 60.1 //--------------------------------------------------------- // >> !!! >> THIS IS A MACHINE-GENERATED FILE << !!! << @@ -13,7 +13,7 @@ //--------------------------------------------------------- zoneinfo64:table(nofallback) { - TZVersion { "2018a" } + TZVersion { "2018b" } Zones:array { /* ACT */ :int { 354 } //Z#0 /* AET */ :int { 366 } //Z#1 diff --git a/icu4c/source/tools/tzcode/Makefile.in b/icu4c/source/tools/tzcode/Makefile.in index f8ab02d6ed5..63c9230086e 100644 --- a/icu4c/source/tools/tzcode/Makefile.in +++ b/icu4c/source/tools/tzcode/Makefile.in @@ -77,12 +77,12 @@ tzorig: $(TZCODE) $(TZDATA) -mv $(TZORIG)/zishrink.awk $(TZORIG)/zishrink.awk.orig sed -e '/if (line ~ \/^R SystemV \/) return/s/^/#/' $(TZORIG)/zishrink.awk.orig > $(TZORIG)/zishrink.awk -mv $(TZORIG)/Makefile $(TZORIG)/Makefile.orig - sed -e "s/BACKWARD=\$$(BACKWARD)/BACKWARD='\$$(BACKWARD)'/" $(TZORIG)/Makefile.orig > $(TZORIG)/Makefile + sed -e "s/^BACKWARD=.*/BACKWARD= backward pacificnew/" $(TZORIG)/Makefile.orig > $(TZORIG)/Makefile $(MAKE) -C $@ $(TZORIG_OPTS) zdump zones $(ZDUMPOUT): tzorig ( cd $(TZORIG) ; ./zdump$(EXEEXT) $(ZDUMP_OPTS) ) - + find $(ZDUMPOUT) -name '*--ICU' -exec sh -c 'mv "$${0}" $${0%--ICU}' {} \; dump-out: $(ZDUMPOUT) $(ICUZDUMPOUT) diff --git a/icu4c/source/tools/tzcode/icuzdump.cpp b/icu4c/source/tools/tzcode/icuzdump.cpp index 3e5ed1debb0..71551ed8d9a 100644 --- a/icu4c/source/tools/tzcode/icuzdump.cpp +++ b/icu4c/source/tools/tzcode/icuzdump.cpp @@ -40,6 +40,7 @@ #include "uoptions.h" using namespace std; +using namespace icu; class DumpFormatter { public: diff --git a/icu4c/source/tools/tzcode/icuzones b/icu4c/source/tools/tzcode/icuzones index 8596bda64a9..841c5f827ca 100644 --- a/icu4c/source/tools/tzcode/icuzones +++ b/icu4c/source/tools/tzcode/icuzones @@ -109,3 +109,6 @@ Zone Europe/Dublin--ICU -0:25:00 - LMT 1880 Aug 2 0:00 - GMT 1948 Apr 18 2:00s 0:00 GB-Eire GMT/IST 1968 Oct 27 0:00 Eire--ICU GMT/IST + +Link Europe/Dublin--ICU Eire--ICU + diff --git a/icu4c/source/tools/tzcode/tz2icu.cpp b/icu4c/source/tools/tzcode/tz2icu.cpp index dff31949bad..b946ffb2c9d 100644 --- a/icu4c/source/tools/tzcode/tz2icu.cpp +++ b/icu4c/source/tools/tzcode/tz2icu.cpp @@ -903,7 +903,6 @@ map finalRules; map > links; map reverseLinks; -map linkSource; // id => "Olson link" or "ICU alias" /** * Predicate used to find FinalRule objects that do not have both @@ -975,9 +974,6 @@ void readFinalZonesAndRules(istream& in) { links[fromid].insert(toid); reverseLinks[toid] = fromid; - - linkSource[fromid] = "Olson link"; - linkSource[toid] = "Olson link"; } else if (token.length() > 0 && token[0] == '#') { consumeLine(in); } else { @@ -1508,7 +1504,7 @@ int main(int argc, char *argv[]) { // Collect zone IDs to be modified with ICU definition. vector customZones; for (ZoneMapIter i = ZONEINFO.begin(); i != ZONEINFO.end(); ++i) { - string id = i->first; + const string& id = i->first; size_t idx = id.rfind(ICU_ZONE_OVERRIDE_SUFFIX); if (idx != string::npos && idx == id.length() - ICU_ZONE_OVERRIDE_SUFFIX_LEN) { cout << "ICU zone override: " << id << endl; @@ -1516,10 +1512,14 @@ int main(int argc, char *argv[]) { } } + // + // BEGIN ICU Custom ZoneInfo Override Handling + // + // Replace zoneinfo with ICU definition, then remove ICU zone ID with // the special suffix. - for (vector::iterator i = customZones.begin(); i < customZones.end(); i++) { - string origId = *i; + for (vector::iterator i = customZones.begin(); i != customZones.end(); i++) { + string& origId = *i; string custId = origId + ICU_ZONE_OVERRIDE_SUFFIX; map::iterator origZi = ZONEINFO.find(origId); @@ -1544,6 +1544,30 @@ int main(int argc, char *argv[]) { } } + // Also remove aliases for ICU custom zoneinfo overrides. + for (map>::const_iterator i = links.begin(); i != links.end(); ) { + const string& id = i->first; + size_t idx = id.rfind(ICU_ZONE_OVERRIDE_SUFFIX); + if (idx != string::npos && idx == id.length() - ICU_ZONE_OVERRIDE_SUFFIX_LEN) { + const set& aliases = i->second; + // Also remove all revserse links + for (set::const_iterator j = aliases.begin(); j != aliases.end(); j++) { + const string& alias = *j; + cout << "Removing alias " << alias << endl; + reverseLinks.erase(alias); + } + + links.erase(i++); + } else { + i++; + } + } + + + // + // END ICU Custom ZoneInfo Override Handling + // + try { for_each(finalZones.begin(), finalZones.end(), mergeFinalZone); } catch (const exception& error) { @@ -1561,7 +1585,7 @@ int main(int argc, char *argv[]) { const string& olson = i->first; const set& aliases = i->second; if (ZONEINFO.find(olson) == ZONEINFO.end()) { - cerr << "Error: Invalid " << linkSource[olson] << " to non-existent \"" + cerr << "Error: Invalid 'Link' to non-existent \"" << olson << "\"" << endl; return 1; } diff --git a/icu4j/main/shared/data/icudata.jar b/icu4j/main/shared/data/icudata.jar index 80a22884f44..795187b09e7 100755 --- a/icu4j/main/shared/data/icudata.jar +++ b/icu4j/main/shared/data/icudata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c49eab66e938bbddc61cd4f5ec09800f8c7546f6496c4c62336869ce0a5f6e3e +oid sha256:0b25843386b6a46ffb45b9d4dc4694cf84f183bf995ea8579653b6420e1ea3c9 size 12475727 diff --git a/icu4j/main/shared/data/icutzdata.jar b/icu4j/main/shared/data/icutzdata.jar index 8b2841bb38f..2c2b0acaf0e 100755 --- a/icu4j/main/shared/data/icutzdata.jar +++ b/icu4j/main/shared/data/icutzdata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c4cf7289cb6a71d2357cb1ba961f5ef499759a9eebe6d4d72c97874dcfbd162 -size 92804 +oid sha256:2747db532b79bf23a4cab51918391b24a8d873a751a44852485882785f53057c +size 92805