From fb434180b191ae0e8d3d17fd7442939d2b563443 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 14 Jan 2020 18:15:30 -0800 Subject: Add support for Expires lines to zic * Makefile (EXPIRES_LINE): New macro. (leapseconds): Use it. * NEWS, zic.8: Mention this. * leapseconds.awk: Also output an "Expires" line, but comment it out for now so that older zic implementations do not reject the generated leapseconds file. * zic.c (LC_EXPIRES, EXPIRES_FIELDS): New macros. (leapexpires): New static var. (leap_line_codes, infile, adjleap): Add support for expiration lines. (getleapdatetime): New function, with much of the former inleap implementation. (inleap): Use it. (inexpires): New function. --- zic.8 | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'zic.8') diff --git a/zic.8 b/zic.8 index dc0220f..0a64fbe 100644 --- a/zic.8 +++ b/zic.8 @@ -606,7 +606,9 @@ However, the behavior is unspecified if multiple zone or link lines define the same name, or if the source of one link line is the target of another. .PP -Lines in the file that describes leap seconds have the following form: +The file that describes leap seconds can have leap lines and an +expiration line. +Leap lines have the following form: .nf .ti +.5i .ta \w'Leap\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +\w'HH:MM:SS\0\0'u +\w'CORR\0\0'u @@ -646,6 +648,43 @@ or .q "Rolling" if the leap second time given by the other fields should be interpreted as local (wall clock) time. +.PP +The expiration line, if present, has the form: +.nf +.ti +.5i +.ta \w'Expires\0\0'u +\w'YEAR\0\0'u +\w'MONTH\0\0'u +\w'DAY\0\0'u +.sp +Expires YEAR MONTH DAY HH:MM:SS +.sp +For example: +.ti +.5i +.sp +Expires 2020 Dec 28 00:00:00 +.sp +.fi +The +.BR YEAR , +.BR MONTH , +.BR DAY , +and +.B HH:MM:SS +fields give the expiration timestamp in UTC for the leap second table; +.B zic +outputs this expiration timestamp by truncating the end of the output +file to the timestamp. +If there is no expiration line, +.B zic +also accepts a comment +.q "#expires \fIE\fP ...\&" +where +.I E +is the expiration timestamp as a decimal integer count of seconds +since the Epoch, not counting leap seconds. +However, the +.q "#expires" +comment is an obsolescent feature, +and the leap second file should use an expiration line +instead of relying on a comment. .SH "EXTENDED EXAMPLE" Here is an extended example of .B zic -- cgit v1.2.1