-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Makefile (ZONETABLES, VERSION_DEPS): Add zonenow.tab. (CHECK_NOW_TIMESTAMP, CHECK_NOW_FUTURE_YEARS, CHECK_NOW_FUTURE_SECS): New macros. (check_now): New target rule. (check_mild): Depend on it. * NEWS: Mention this new feature. * checknow.awk, zonenow.tab: New files. * checktab.awk: Adjust (i.e., loosen) checks for zonenow.tab. * tzselect.ksh (TZ_ZONETABTYPE_TABLE, TZ_ZONENOW_TABLE): New vars, so that the code can switch back and for easily between zone1970.tab and zonenow.tab. (TZ_ZONE_TABLE): Set to one of those two vars, depending on user. Let users choose ‘now’ if they care only about timestamps from now on. Narrow ‘regions’ based on ‘now’ selection, if possible (which it always is, with the current data).
- Loading branch information
Showing
6 changed files
with
435 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Check zonenow.tab for consistency with primary data. | ||
|
||
# Contributed by Paul Eggert. This file is in the public domain. | ||
|
||
function record_zone(zone, data) { | ||
if (zone) { | ||
zone_data[zone] = data | ||
zones[data] = zones[data] " " zone | ||
} | ||
} | ||
|
||
BEGIN { | ||
while (getline <zdump_table) { | ||
if ($0 ~ /^TZ/) { | ||
record_zone(zone, data) | ||
zone = $0 | ||
sub(/.*\.dir\//, "", zone) | ||
sub(/"/, "", zone) | ||
data = "" | ||
} else if ($0 ~ /./) | ||
data = data $0 "\n" | ||
} | ||
record_zone(zone, data) | ||
FS = "\t" | ||
} | ||
|
||
/^[^#]/ { | ||
zone = $3 | ||
data = zone_data[zone] | ||
if (!data) { | ||
printf "%s: no data\n" | ||
status = 1 | ||
} else { | ||
zone2 = zonenow[data] | ||
if (zone2) { | ||
printf "zones %s and %s identical from now on\n", zone, zone2 | ||
status = 1 | ||
} else | ||
zonenow[data] = zone | ||
} | ||
} | ||
|
||
END { | ||
for (zone in zone_data) { | ||
data = zone_data[zone] | ||
if (!zonenow[data]) { | ||
printf "checknow.tab should have one of:%s\n", zones[data] | ||
zonenow[data] = zone # This suppresses duplicate diagnostics. | ||
status = 1 | ||
} | ||
} | ||
exit status | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.