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
This commit is contained in:
Yoshito Umaoka 2018-01-24 01:37:07 +00:00
parent 0dc85d2408
commit a222a6fa25
7 changed files with 44 additions and 16 deletions

View File

@ -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

View File

@ -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)

View File

@ -40,6 +40,7 @@
#include "uoptions.h"
using namespace std;
using namespace icu;
class DumpFormatter {
public:

View File

@ -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

View File

@ -903,7 +903,6 @@ map<string,FinalRule> finalRules;
map<string, set<string> > links;
map<string, string> reverseLinks;
map<string, string> 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<string> 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<string>::iterator i = customZones.begin(); i < customZones.end(); i++) {
string origId = *i;
for (vector<string>::iterator i = customZones.begin(); i != customZones.end(); i++) {
string& origId = *i;
string custId = origId + ICU_ZONE_OVERRIDE_SUFFIX;
map<string,ZoneInfo>::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<string,set<string>>::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<string>& aliases = i->second;
// Also remove all revserse links
for (set<string>::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<string>& 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;
}

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c49eab66e938bbddc61cd4f5ec09800f8c7546f6496c4c62336869ce0a5f6e3e
oid sha256:0b25843386b6a46ffb45b9d4dc4694cf84f183bf995ea8579653b6420e1ea3c9
size 12475727

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c4cf7289cb6a71d2357cb1ba961f5ef499759a9eebe6d4d72c97874dcfbd162
size 92804
oid sha256:2747db532b79bf23a4cab51918391b24a8d873a751a44852485882785f53057c
size 92805