mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-05-06 14:07:48 +00:00
Check for links to links.
This problem has come up before, and it's time to add a check to catch this common error. * Makefile (AWK_SCRIPTS): Add checklinks.awk. (check, .PHONY): Add check_links. (check_links): New rule. * checklinks.awk: New file.
This commit is contained in:
10
Makefile
10
Makefile
@@ -359,7 +359,7 @@ TABDATA= iso3166.tab leapseconds $(ZONETABLES)
|
||||
LEAP_DEPS= leapseconds.awk leap-seconds.list
|
||||
DATA= $(YDATA) $(NDATA) backzone $(TABDATA) \
|
||||
leap-seconds.list yearistype.sh
|
||||
AWK_SCRIPTS= checktab.awk leapseconds.awk
|
||||
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk
|
||||
MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl
|
||||
ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)
|
||||
|
||||
@@ -468,7 +468,7 @@ tzselect: tzselect.ksh
|
||||
<$? >$@
|
||||
chmod +x $@
|
||||
|
||||
check: check_character_set check_white_space check_sorted \
|
||||
check: check_character_set check_white_space check_links check_sorted \
|
||||
check_tables check_web
|
||||
|
||||
check_character_set: $(ENCHILADA)
|
||||
@@ -500,6 +500,9 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
|
||||
$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
|
||||
LC_ALL=C sort -cu
|
||||
|
||||
check_links: checklinks.awk $(TDATA)
|
||||
$(AWK) -f checklinks.awk $(TDATA)
|
||||
|
||||
check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
|
||||
for tab in $(ZONETABLES); do \
|
||||
$(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
|
||||
@@ -662,7 +665,8 @@ zic.o: private.h tzfile.h version.h
|
||||
.KEEP_STATE:
|
||||
|
||||
.PHONY: ALL INSTALL all
|
||||
.PHONY: check check_character_set check_public check_sorted check_tables
|
||||
.PHONY: check check_character_set check_links
|
||||
.PHONY: 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
|
||||
|
||||
19
checklinks.awk
Normal file
19
checklinks.awk
Normal file
@@ -0,0 +1,19 @@
|
||||
# Check links in tz tables.
|
||||
|
||||
# Contributed by Paul Eggert.
|
||||
|
||||
/^Link/ { used[$2] = 1 }
|
||||
/^Zone/ { defined[$2] = 1 }
|
||||
|
||||
END {
|
||||
status = 0
|
||||
|
||||
for (tz in used) {
|
||||
if (!defined[tz]) {
|
||||
printf "%s: Link to non-zone\n", tz
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
|
||||
exit status
|
||||
}
|
||||
Reference in New Issue
Block a user