Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time Sync with 2019b:



details:   https://anonhg.NetBSD.org/src/rev/a44711508ba5
branches:  trunk
changeset: 1000056:a44711508ba5
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 03 15:50:16 2019 +0000

description:
Sync with 2019b:

    zic's new -b option supports a way to control data bloat and to
    test for year-2038 bugs in software that reads TZif files.
    'zic -b fat' and 'zic -b slim' generate larger and smaller output;
    for example, changing from fat to slim shrinks the Europe/London
    file from 3648 to 1599 bytes, saving about 56%.  Fat and slim
    files represent the same set of timestamps and use the same TZif
    format as documented in tzfile(5) and in Internet RFC 8536.
    Fat format attempts to work around bugs or incompatibilities in
    older software, notably software that mishandles 64-bit TZif data
    or uses obsolete TZ strings like "EET-2EEST" that lack DST rules.
    Slim format is more efficient and does not work around 64-bit bugs
    or obsolete TZ strings.  Currently zic defaults to fat format
    unless you compile with -DZIC_BLOAT_DEFAULT=\"slim\"; this
    out-of-the-box default is intended to change in future releases
    as the buggy software often mishandles timestamps anyway.

    zic no longer treats a set of rules ending in 2037 specially.
    Previously, zic assumed that such a ruleset meant that future
    timestamps could not be predicted, and therefore omitted a
    POSIX-like TZ string in the TZif output.  The old behavior is no
    longer needed for current tzdata, and caused problems with newlib
    when used with older tzdata (reported by David Gauchard).

    zic no longer generates some artifact transitions.  For example,
    Europe/London no longer has a no-op transition in January 1996.

diffstat:

 lib/libc/time/Makefile       |   45 +++-
 lib/libc/time/NEWS           |  104 +++++++++-
 lib/libc/time/localtime.c    |  103 +++++-----
 lib/libc/time/theory.html    |   26 +-
 lib/libc/time/tz-art.html    |   48 ++--
 lib/libc/time/tz-how-to.html |   30 +-
 lib/libc/time/tz-link.html   |  177 ++++++++++++-----
 lib/libc/time/tzfile.5       |   95 ++++++--
 lib/libc/time/tzset.3        |    6 +-
 lib/libc/time/version        |    2 +-
 lib/libc/time/zic.8          |  213 ++++++++++++++------
 lib/libc/time/zic.c          |  426 +++++++++++++++++++++++-------------------
 12 files changed, 817 insertions(+), 458 deletions(-)

diffs (truncated from 3028 to 300 lines):

diff -r 9df65b25fa9f -r a44711508ba5 lib/libc/time/Makefile
--- a/lib/libc/time/Makefile    Wed Jul 03 15:49:21 2019 +0000
+++ b/lib/libc/time/Makefile    Wed Jul 03 15:50:16 2019 +0000
@@ -35,11 +35,13 @@
 
 LOCALTIME=     GMT
 
-# If you want something other than Eastern United States time as a template
-# for handling ruleless POSIX-style timezone environment variables,
+# The POSIXRULES macro controls interpretation of nonstandard and obsolete
+# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules.
+# In the reference implementation, if you want something other than Eastern
+# United States time as a template for handling these settings, you can
 # change the line below (after finding the timezone you want in the
 # one of the $(TDATA) source files, or adding it to a source file).
-# A ruleless environment setting like TZ='CST6CDT' uses the rules in the
+# A setting like TZ='EET-2EEST' is supposed to use the rules in the
 # template file to determine "spring forward" and "fall back" days and
 # times; the environment variable itself specifies UT offsets of standard and
 # daylight saving time.
@@ -49,6 +51,17 @@
 # Use the command
 #      make zonenames
 # to get a list of the values you can use for POSIXRULES.
+#
+# If POSIXRULES is empty, no template is installed; this is the intended
+# future default for POSIXRULES.
+#
+# Nonempty POSIXRULES is obsolete and should not be relied on, because:
+# * It does not work correctly in popular implementations such as GNU/Linux.
+# * It does not work in the tzdb implementation for timestamps after 2037.
+# * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions
+#   at standard time or UT rather than at local time.
+# In short, software should avoid ruleless settings like TZ='EET-2EEST'
+# and so should not depend on the value of POSIXRULES.
 
 POSIXRULES=    America/New_York
 
@@ -231,6 +244,13 @@
 #      other than simply getting garbage data
 #  -DUSE_LTZ=0 to build zdump with the system time zone library
 #      Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
+#  -DZIC_BLOAT_DEFAULT=\"slim\" to default zic's -b option to "slim", and
+#      similarly for "fat".  Fat TZif files work around incompatibilities
+#      and bugs in some TZif readers, notably readers that mishandle 64-bit
+#      data in TZif files.  Slim TZif files are more efficient and do not
+#      work around these incompatibilities and bugs.  If not given, the
+#      current default is "fat" but this is intended to change as readers
+#      requiring fat files often mishandle timestamps after 2037 anyway.
 #  -DZIC_MAX_ABBR_LEN_WO_WARN=3
 #      (or some other number) to set the maximum time zone abbreviation length
 #      that zic will accept without a warning (the default is 6)
@@ -364,7 +384,9 @@
 
 # To shrink the size of installed TZif files,
 # append "-r @N" to omit data before N-seconds-after-the-Epoch.
-# See the zic man page for more about -r.
+# You can also append "-b slim" if that is not already the default;
+# see ZIC_BLOAT_DEFAULT above.
+# See the zic man page for more about -b and -r.
 ZFLAGS=
 
 # How to use zic to install TZif files.
@@ -388,6 +410,9 @@
 # Name of curl <https://curl.haxx.se/>, used for HTML validation.
 CURL=          curl
 
+# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions.
+GPG=           gpg
+
 # The path where SGML DTDs are kept and the catalog file(s) to use when
 # validating HTML 4.01.  The default should work on both Debian and Red Hat.
 SGML_TOPDIR= /usr
@@ -562,7 +587,9 @@
                        '$(DESTDIR)$(LIBDIR)' \
                        '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
                        '$(DESTDIR)$(MANDIR)/man8'
-               $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
+               $(ZIC_INSTALL) -l $(LOCALTIME) \
+                       `case '$(POSIXRULES)' in ?*) echo '-p';; esac \
+                       ` $(POSIXRULES) \
                        -t '$(DESTDIR)$(TZDEFAULT)'
                cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
                cp tzselect '$(DESTDIR)$(BINDIR)/.'
@@ -781,12 +808,6 @@
 check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
                $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
                $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
-               $(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
-               $(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
-               $(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
-                 LC_ALL=C sort -c
-               $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
-                 LC_ALL=C sort -cu
                touch $@
 
 check_links:   checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
@@ -1051,7 +1072,7 @@
 tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
 tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
 $(ALL_ASC):
-               gpg2 --armor --detach-sign $?
+               $(GPG) --armor --detach-sign $?
 
 TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T
 typecheck: typecheck_long_long typecheck_unsigned
diff -r 9df65b25fa9f -r a44711508ba5 lib/libc/time/NEWS
--- a/lib/libc/time/NEWS        Wed Jul 03 15:49:21 2019 +0000
+++ b/lib/libc/time/NEWS        Wed Jul 03 15:50:16 2019 +0000
@@ -1,6 +1,100 @@
 News for the tz database
 
-Release 20198 - 2019-03-25 22:01:33 -0700
+Release 2019b - 2019-07-01 00:09:53 -0700
+
+  Briefly:
+    Brazil no longer observes DST.
+    'zic -b slim' outputs smaller TZif files; please try it out.
+    Palestine's 2019 spring-forward transition was on 03-29, not 03-30.
+
+  Changes to future timestamps
+
+    Brazil has canceled DST and will stay on standard time indefinitely.
+    (Thanks to Steffen Thorsen, Marcus Diniz, and Daniel Soares de
+    Oliveira.)
+
+    Predictions for Morocco now go through 2087 instead of 2037, to
+    work around a problem on newlib when using TZif files output by
+    zic 2019a or earlier.  (Problem reported by David Gauchard.)
+
+  Changes to past and future timestamps
+
+    Palestine's 2019 spring transition was 03-29 at 00:00, not 03-30
+    at 01:00.  (Thanks to Sharef Mustafa and Even Scharning.)  Guess
+    future transitions to be March's last Friday at 00:00.
+
+  Changes to past timestamps
+
+    Hong Kong's 1941-06-15 spring-forward transition was at 03:00, not
+    03:30.  Its 1945 transition from JST to HKT was on 11-18 at 02:00,
+    not 09-15 at 00:00.  In 1946 its spring-forward transition was on
+    04-21 at 00:00, not the previous day at 03:30.  From 1946 through
+    1952 its fall-back transitions occurred at 04:30, not at 03:30.
+    In 1947 its fall-back transition was on 11-30, not 12-30.
+    (Thanks to P Chan.)
+
+  Changes to past time zone abbreviations
+
+    Italy's 1866 transition to Rome Mean Time was on December 12, not
+    September 22.  This affects only the time zone abbreviation for
+    Europe/Rome between those dates.  (Thanks to Stephen Trainor and
+    Luigi Rosa.)
+
+  Changes affecting metadata only
+
+    Add info about the Crimea situation in zone1970.tab and zone.tab.
+    (Problem reported by Serhii Demediuk.)
+
+  Changes to code
+
+    zic's new -b option supports a way to control data bloat and to
+    test for year-2038 bugs in software that reads TZif files.
+    'zic -b fat' and 'zic -b slim' generate larger and smaller output;
+    for example, changing from fat to slim shrinks the Europe/London
+    file from 3648 to 1599 bytes, saving about 56%.  Fat and slim
+    files represent the same set of timestamps and use the same TZif
+    format as documented in tzfile(5) and in Internet RFC 8536.
+    Fat format attempts to work around bugs or incompatibilities in
+    older software, notably software that mishandles 64-bit TZif data
+    or uses obsolete TZ strings like "EET-2EEST" that lack DST rules.
+    Slim format is more efficient and does not work around 64-bit bugs
+    or obsolete TZ strings.  Currently zic defaults to fat format
+    unless you compile with -DZIC_BLOAT_DEFAULT=\"slim\"; this
+    out-of-the-box default is intended to change in future releases
+    as the buggy software often mishandles timestamps anyway.
+
+    zic no longer treats a set of rules ending in 2037 specially.
+    Previously, zic assumed that such a ruleset meant that future
+    timestamps could not be predicted, and therefore omitted a
+    POSIX-like TZ string in the TZif output.  The old behavior is no
+    longer needed for current tzdata, and caused problems with newlib
+    when used with older tzdata (reported by David Gauchard).
+
+    zic no longer generates some artifact transitions.  For example,
+    Europe/London no longer has a no-op transition in January 1996.
+
+  Changes to build procedure
+
+    tzdata.zi now assumes zic 2017c or later.  This shrinks tzdata.zi
+    by a percent or so.
+
+  Changes to documentation and commentary
+
+    The Makefile now documents the POSIXRULES macro as being obsolete,
+    and similarly, zic's -p POSIXRULES option is now documented as
+    being obsolete.  Although the POSIXRULES feature still exists and
+    works as before, in practice it is rarely used for its intended
+    purpose, and it does not work either in the default reference
+    implementation (for timestamps after 2037) or in common
+    implementations such as GNU/Linux (for contemporary timestamps).
+    Since POSIXRULES was designed primarily as a temporary transition
+    facility for System V platforms that died off decades ago, it is
+    being decommissioned rather than institutionalized.
+
+    New info on Bonin Islands and Marcus (thanks to Wakaba and Phake Nick).
+
+
+Release 2019a - 2019-03-25 22:01:33 -0700
 
   Briefly:
     Palestine "springs forward" on 2019-03-30 instead of 2019-03-23.
@@ -481,7 +575,7 @@
     The code is a bit more portable to MS-Windows.  Installers can
     compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that
     reserve identifiers like 'localtime'.  (Thanks to Manuela
-    Friedrich).
+    Friedrich.)
 
   Changes to documentation and commentary
 
@@ -2276,7 +2370,7 @@
     warlord Jin Shuren in the data.
 
     Commentary about the coverage of each Russian zone has been standardized.
-    (Thanks to Tim Parenti).
+    (Thanks to Tim Parenti.)
 
     There is new commentary about contemporary timekeeping in Ethiopia.
 
@@ -2724,7 +2818,7 @@
 
     Change the UT offset of Bern Mean Time from 0:29:44 to 0:29:46.
     This affects Europe/Zurich timestamps from 1853 to 1894.  (Thanks
-    to Alois Treindl).
+    to Alois Treindl.)
 
     Change the date of the circa-1850 Zurich transition from 1849-09-12
     to 1853-07-16, overriding Shanks with data from Messerli about
@@ -3034,7 +3128,7 @@
     (Thanks to Arthur David Olson.)
 
     Improve the commentary about which districts observe what times
-    in Russia.  (Thanks to Oscar van Vlijmen and Arthur David Olson).
+    in Russia.  (Thanks to Oscar van Vlijmen and Arthur David Olson.)
 
     Add web page links to tz.js.
 
diff -r 9df65b25fa9f -r a44711508ba5 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Wed Jul 03 15:49:21 2019 +0000
+++ b/lib/libc/time/localtime.c Wed Jul 03 15:50:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localtime.c,v 1.121 2019/04/17 17:37:29 christos Exp $ */
+/*     $NetBSD: localtime.c,v 1.122 2019/07/03 15:50:16 christos Exp $ */
 
 /* Convert timestamp from time_t to struct tm.  */
 
@@ -12,7 +12,7 @@
 #if 0
 static char    elsieid[] = "@(#)localtime.c    8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.121 2019/04/17 17:37:29 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.122 2019/07/03 15:50:16 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -104,11 +104,11 @@
 #endif
 
 struct ttinfo {                                /* time type information */
-       int_fast32_t    tt_gmtoff;      /* UT offset in seconds */
+       int_fast32_t    tt_utoff;       /* UT offset in seconds */
        bool            tt_isdst;       /* used to set tm_isdst */
-       int             tt_abbrind;     /* abbreviation list index */
+       int             tt_desigidx;    /* abbreviation list index */
        bool            tt_ttisstd;     /* transition is std time */
-       bool            tt_ttisgmt;     /* transition is UT */
+       bool            tt_ttisut;      /* transition is UT */
 };
 
 struct lsinfo {                                /* leap second information */
@@ -227,15 +227,15 @@
 # endif /* defined ALTZONE */
 #endif /* !HAVE_POSIX_DECLS */
 
-/* Initialize *S to a value based on GMTOFF, ISDST, and ABBRIND.  */
+/* Initialize *S to a value based on UTOFF, ISDST, and DESIGIDX.  */
 static void
-init_ttinfo(struct ttinfo *s, int_fast32_t gmtoff, bool isdst, int abbrind)
+init_ttinfo(struct ttinfo *s, int_fast32_t utoff, bool isdst, int desigidx)
 {
-       s->tt_gmtoff = gmtoff;
+       s->tt_utoff = utoff;
        s->tt_isdst = isdst;
-       s->tt_abbrind = abbrind;
+       s->tt_desigidx = desigidx;
        s->tt_ttisstd = false;
-       s->tt_ttisgmt = false;
+       s->tt_ttisut = false;
 }
 



Home | Main Index | Thread Index | Old Index