[tz] [PROPOSED PATCH 2/2] Check that supposedly-sorted source files actually are sorted.

Paul Eggert eggert at cs.ucla.edu
Sat Sep 6 22:13:20 UTC 2014


* Makefile (check_sorted): New rule.
(check, .PHONY): Add it.
* backzone: Sort.
---
 Makefile | 12 ++++++++++--
 backzone | 20 ++++++++++----------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 00611dd..8e0a6d7 100644
--- a/Makefile
+++ b/Makefile
@@ -467,7 +467,8 @@ tzselect:	tzselect.ksh
 			<$? >$@
 		chmod +x $@
 
-check:		check_character_set check_white_space check_tables check_web
+check:		check_character_set check_white_space check_sorted \
+		  check_tables check_web
 
 check_character_set: $(ENCHILADA)
 		LC_ALL=en_US.utf8 && export LC_ALL && \
@@ -486,6 +487,13 @@ check_white_space: $(ENCHILADA)
 		! grep -n '[[:space:]]$$' $(ENCHILADA)
 		! grep -n "$$(printf '[\f\r\v]\n')" $(ENCHILADA)
 
+check_sorted: backward backzone iso3166.tab zone1970.tab
+		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -c
+		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -c
+		$(AWK) '/^[^#]/ {print}' iso3166.tab | LC_ALL=C sort -c
+		$(AWK) '/^[^#]/ {print substr($0, 1, 2)}' zone1970.tab | \
+		  LC_ALL=C sort -c
+
 check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
 		for tab in $(ZONETABLES); do \
 		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
@@ -648,7 +656,7 @@ zic.o:		private.h tzfile.h version.h
 .KEEP_STATE:
 
 .PHONY: ALL INSTALL all
-.PHONY: check check_character_set check_public check_tables
+.PHONY: check check_character_set check_public check_sorted check_tables
 .PHONY: check_time_t_alternatives check_web check_white_space clean clean_misc
 .PHONY: install maintainer-clean names posix_packrat posix_only posix_right
 .PHONY: public right_only right_posix signatures tarballs typecheck
diff --git a/backzone b/backzone
index d63afab..22ac5c0 100644
--- a/backzone
+++ b/backzone
@@ -315,16 +315,6 @@ Link Antarctica/McMurdo Antarctica/South_Pole
 #Zone	  Asia/Chennai  [not enough info to complete]
 
 # China
-# Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
-# Heilongjiang (except Mohe county), Jilin
-Zone	Asia/Harbin	8:26:44	-	LMT	1928     # or Haerbin
-			8:30	-	CHAT	1932 Mar # Changbai Time
-			8:00	-	CST	1940
-			9:00	-	CHAT	1966 May
-			8:30	-	CHAT	1980 May
-			8:00	PRC	C%sT
-
-# China
 # Long-shu Time (probably due to Long and Shu being two names of that area)
 # Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
 # most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
@@ -335,6 +325,16 @@ Zone	Asia/Chongqing	7:06:20	-	LMT	1928     # or Chungking
 			8:00	PRC	C%sT
 Link Asia/Chongqing Asia/Chungking
 
+# China
+# Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
+# Heilongjiang (except Mohe county), Jilin
+Zone	Asia/Harbin	8:26:44	-	LMT	1928     # or Haerbin
+			8:30	-	CHAT	1932 Mar # Changbai Time
+			8:00	-	CST	1940
+			9:00	-	CHAT	1966 May
+			8:30	-	CHAT	1980 May
+			8:00	PRC	C%sT
+
 # far west China
 Zone	Asia/Kashgar	5:03:56	-	LMT	1928     # or Kashi or Kaxgar
 			5:30	-	KAST	1940     # Kashgar Time
-- 
1.9.1



More information about the tz mailing list