[tz] [PATCH 4/5] Improve checking for shortcut links
Paul Eggert
eggert at cs.ucla.edu
Mon Sep 26 00:32:20 UTC 2022
* backward: Add comments for shortcut links.
* checklinks.awk: Check these links.
---
backward | 34 ++++++++++++++++++++++------------
checklinks.awk | 13 +++++++++++++
2 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/backward b/backward
index f61c260..b2ccbc1 100644
--- a/backward
+++ b/backward
@@ -16,11 +16,21 @@
# This file is divided into sections, one for each major reason for a
# backward compatibility link. Each section is sorted by link name.
+# A "#= TARGET1" comment labels each link inserted only because some
+# .zi parsers mishandle links to links. The comment says what the
+# target would be if these parsers were fixed so that data could
+# contain links to links. For example, the line
+# "Link Australia/Sydney Australia/ACT #= Australia/Canberra" would be
+# "Link Australia/Canberra Australia/ACT" were it not that data lines
+# refrain from linking to links like Australia/Canberra, which means
+# the Australia/ACT line links instead to Australia/Sydney,
+# Australia/Canberra's target.
+
# Pre-1993 naming conventions
-# Link TARGET LINK-NAME
-Link Australia/Sydney Australia/ACT
+# Link TARGET LINK-NAME #= TARGET1
+Link Australia/Sydney Australia/ACT #= Australia/Canberra
Link Australia/Lord_Howe Australia/LHI
Link Australia/Sydney Australia/NSW
Link Australia/Darwin Australia/North
@@ -30,7 +40,7 @@ Link Australia/Hobart Australia/Tasmania
Link Australia/Melbourne Australia/Victoria
Link Australia/Perth Australia/West
Link Australia/Broken_Hill Australia/Yancowinna
-Link America/Rio_Branco Brazil/Acre
+Link America/Rio_Branco Brazil/Acre #= America/Porto_Acre
Link America/Noronha Brazil/DeNoronha
Link America/Sao_Paulo Brazil/East
Link America/Manaus Brazil/West
@@ -79,7 +89,7 @@ Link Etc/GMT GMT0
Link Etc/GMT Greenwich
# End of rearguard section.
Link Asia/Hong_Kong Hongkong
-Link Africa/Abidjan Iceland
+Link Africa/Abidjan Iceland #= Atlantic/Reykjavik
Link Asia/Tehran Iran
Link Asia/Jerusalem Israel
Link America/Jamaica Jamaica
@@ -91,7 +101,7 @@ Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General
Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
-Link America/Denver Navajo
+Link America/Denver Navajo #= America/Shiprock
Link Asia/Shanghai PRC
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
@@ -120,7 +130,7 @@ Link Etc/UTC Zulu
# Two-part names that were renamed mostly to three-part names in 1995
-# Link TARGET LINK-NAME
+# Link TARGET LINK-NAME #= TARGET1
Link America/Argentina/Buenos_Aires America/Buenos_Aires
Link America/Argentina/Catamarca America/Catamarca
Link America/Argentina/Cordoba America/Cordoba
@@ -129,7 +139,7 @@ Link America/Argentina/Jujuy America/Jujuy
Link America/Indiana/Knox America/Knox_IN
Link America/Kentucky/Louisville America/Louisville
Link America/Argentina/Mendoza America/Mendoza
-Link America/Puerto_Rico America/Virgin
+Link America/Puerto_Rico America/Virgin #= America/St_Thomas
Link Pacific/Pago_Pago Pacific/Samoa
@@ -279,12 +289,12 @@ Link Pacific/Port_Moresby Pacific/Yap
# Alternate names for the same location
-# Link TARGET LINK-NAME
-Link Africa/Nairobi Africa/Asmera
+# Link TARGET LINK-NAME #= TARGET1
+Link Africa/Nairobi Africa/Asmera #= Africa/Asmara
Link America/Nuuk America/Godthab
Link Asia/Ashgabat Asia/Ashkhabad
Link Asia/Kolkata Asia/Calcutta
-Link Asia/Shanghai Asia/Chungking
+Link Asia/Shanghai Asia/Chungking #= Asia/Chongqing
Link Asia/Dhaka Asia/Dacca
# Istanbul is in both continents.
Link Europe/Istanbul Asia/Istanbul
@@ -300,5 +310,5 @@ Link Europe/Kyiv Europe/Kiev
# Classically, Cyprus is in Asia; e.g. see Herodotus, Histories, I.72.
# However, for various reasons many users expect to find it under Europe.
Link Asia/Nicosia Europe/Nicosia
-Link Pacific/Guadalcanal Pacific/Ponape
-Link Pacific/Port_Moresby Pacific/Truk
+Link Pacific/Guadalcanal Pacific/Ponape #= Pacific/Pohnpei
+Link Pacific/Port_Moresby Pacific/Truk #= Pacific/Chuuk
diff --git a/checklinks.awk b/checklinks.awk
index b2bb17a..6e4fda8 100644
--- a/checklinks.awk
+++ b/checklinks.awk
@@ -36,6 +36,9 @@ BEGIN {
printf "%s: Link should be in '%s'\n", $3, backcheck
status = 1
}
+ if ($4 == "#=") {
+ shortcut[$5] = $3
+ }
used[$2] = 1
defined[$3] = $2
}
@@ -47,6 +50,16 @@ END {
status = 1
}
}
+ for (tz in shortcut) {
+ if (defined[shortcut[tz]] != defined[tz]) {
+ target = (!defined[tz] ? "absence" \
+ : defined[tz] == "\n" ? "zone" \
+ : defined[tz])
+ printf "%s: target %s disagrees with %s's target %s\n", \
+ tz, target, shortcut[tz], defined[shortcut[tz]]
+ status = 1
+ }
+ }
exit status
}
--
2.37.3
More information about the tz
mailing list