about summary refs log tree commit diff
path: root/timezone/checktab.awk
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-12-20 13:10:07 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-12-20 13:10:07 +0000
commit85bff96ad652b463f83d4cf19239eff1535e186a (patch)
treed651b5e72fe828f47613e6813ac5d54b0b7aaf66 /timezone/checktab.awk
parentb7867a3bfb9d7e00204c088feb227abddfc7bb43 (diff)
downloadglibc-85bff96ad652b463f83d4cf19239eff1535e186a.tar.gz
glibc-85bff96ad652b463f83d4cf19239eff1535e186a.tar.xz
glibc-85bff96ad652b463f83d4cf19239eff1535e186a.zip
Update timezone code from tzcode 2013i.
Now we have Paul's support for version-3 tz files checked in, this
patch updates all the code we take (unmodified) from tzcode to version
2013i (which includes the support for generating version-3 tz files
where necessary).

Tested x86_64.

	* timezone/checktab.awk: Update from tzcode 2013i.
	* timezone/private.h: Likewise.
	* timezone/scheck.c: Likewise.
	* timezone/tzfile.h: Likewise.
	* timezone/tzselect.ksh: Likewise.
	* timezone/zdump.c: Likewise.
	* timezone/zic.c: Likewise.
Diffstat (limited to 'timezone/checktab.awk')
-rw-r--r--timezone/checktab.awk29
1 files changed, 16 insertions, 13 deletions
diff --git a/timezone/checktab.awk b/timezone/checktab.awk
index c88b12f1ba..fec4f628e5 100644
--- a/timezone/checktab.awk
+++ b/timezone/checktab.awk
@@ -9,6 +9,9 @@ BEGIN {
 	if (!zone_table) zone_table = "zone.tab"
 	if (!want_warnings) want_warnings = -1
 
+	# A special (and we hope temporary) case.
+	tztab["America/Montreal"] = 1
+
 	while (getline <iso_table) {
 		iso_NR++
 		if ($0 ~ /^#/) continue
@@ -69,13 +72,10 @@ BEGIN {
 			status = 1
 		}
 		cc0 = cc
-		if (tz2cc[tz]) {
-			printf "%s:%d: %s: duplicate TZ column\n", \
-				zone_table, zone_NR, tz >>"/dev/stderr"
-			status = 1
-		}
-		tz2cc[tz] = cc
-		tz2comments[tz] = comments
+		cctz = cc tz
+		cctztab[cctz] = 1
+		tztab[tz] = 1
+		tz2comments[cctz] = comments
 		tz2NR[tz] = zone_NR
 		if (cc2name[cc]) {
 			cc_used[cc]++
@@ -92,16 +92,19 @@ BEGIN {
 		}
 	}
 
-	for (tz in tz2cc) {
-		if (cc_used[tz2cc[tz]] == 1) {
-			if (tz2comments[tz]) {
+	for (cctz in cctztab) {
+		cc = substr (cctz, 1, 2)
+		tz = substr (cctz, 3)
+		if (cc_used[cc] == 1) {
+			if (tz2comments[cctz]) {
 				printf "%s:%d: unnecessary comment `%s'\n", \
-					zone_table, tz2NR[tz], tz2comments[tz] \
+					zone_table, tz2NR[tz], \
+					tz2comments[cctz] \
 					>>"/dev/stderr"
 				status = 1
 			}
 		} else {
-			if (!tz2comments[tz]) {
+			if (!tz2comments[cctz]) {
 				printf "%s:%d: missing comment\n", \
 					zone_table, tz2NR[tz] >>"/dev/stderr"
 				status = 1
@@ -125,7 +128,7 @@ BEGIN {
 		if (src != dst) tz = $3
 	}
 	if (tz && tz ~ /\//) {
-		if (!tz2cc[tz]) {
+		if (!tztab[tz]) {
 			printf "%s: no data for `%s'\n", zone_table, tz \
 				>>"/dev/stderr"
 			status = 1