summaryrefslogtreecommitdiffstats
path: root/debian/patches/Correct-timezone-symlinks-when-using-BACKWARD-backward-PA.patch
blob: 293b45ebe26e325478e46701607984ba2b1a0fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From: Benjamin Drung <benjamin.drung@canonical.com>
Date: Wed, 3 Apr 2024 15:14:50 +0200
Subject: Correct timezone symlinks when using BACKWARD=backward
 PACKRATDATA=backzone

When using BACKWARD=backward PACKRATDATA=backzone the symlinks might
point to the incorrect file (e.g. Africa/Asmera points to Africa/Nairobi
instead of Africa/Asmara).

Move the link to link feature from vanguard to main dataform to produce
correct symlink (e.g. Africa/Asmera -> Africa/Asmara) in this case. Drop
those link from `backward` that would cause symlinks to symlinks.

See https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/2062522

Forwarded: https://mm.icann.org/pipermail/tz/2024-April/058853.html
---
 backward    | 8 ++++----
 ziguard.awk | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/backward b/backward
index 65c711b..16a01e5 100644
--- a/backward
+++ b/backward
@@ -30,7 +30,7 @@
 # Pre-1993 naming conventions
 
 # Link	TARGET			LINK-NAME	#= TARGET1
-Link	Australia/Sydney	Australia/ACT	#= Australia/Canberra
+Link	Australia/Sydney	Australia/ACT
 Link	Australia/Lord_Howe	Australia/LHI
 Link	Australia/Sydney	Australia/NSW
 Link	Australia/Darwin	Australia/North
@@ -40,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	#= America/Porto_Acre
+Link	America/Rio_Branco	Brazil/Acre
 Link	America/Noronha		Brazil/DeNoronha
 Link	America/Sao_Paulo	Brazil/East
 Link	America/Manaus		Brazil/West
@@ -101,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	#= America/Shiprock
+Link	America/Denver		Navajo
 Link	Asia/Shanghai		PRC
 Link	Europe/Warsaw		Poland
 Link	Europe/Lisbon		Portugal
@@ -298,7 +298,7 @@ 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	#= Asia/Chongqing
+Link	Asia/Shanghai		Asia/Chungking
 Link	Asia/Dhaka		Asia/Dacca
 # Istanbul is in both continents.
 Link	Europe/Istanbul		Asia/Istanbul
diff --git a/ziguard.awk b/ziguard.awk
index 7a3404f..f6b8d24 100644
--- a/ziguard.awk
+++ b/ziguard.awk
@@ -340,7 +340,7 @@ function make_linkline(oldline, target, linkname, oldtarget, comment, \
   return "Link\t" target "\t" replsuffix comment
 }
 
-/^Link/ && $4 == "#=" && DATAFORM == "vanguard" {
+/^Link/ && $4 == "#=" && (DATAFORM != "rearguard") {
   $0 = make_linkline($0, $5, $3, $2)
 }
 
@@ -378,7 +378,7 @@ function cut_link_chains_short( \
 }
 
 END {
-  if (DATAFORM != "vanguard") {
+  if (DATAFORM == "rearguard") {
     cut_link_chains_short()
   }
   for (i = 1; i <= NR; i++)