Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time merge tzcode2015a:



details:   https://anonhg.NetBSD.org/src/rev/c702f5f1dfca
branches:  trunk
changeset: 335939:c702f5f1dfca
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 31 18:55:17 2015 +0000

description:
merge tzcode2015a:

tzalloc now scrubs time zone abbreviations compatibly with the way
that tzset always has, by replacing invalid bytes with '_' and by
shortening too-long abbreviations.

diffstat:

 lib/libc/time/Makefile     |  18 ++++++++-----
 lib/libc/time/NEWS         |  52 +++++++++++++++++++++++++++++++++++++++
 lib/libc/time/localtime.c  |  61 ++++++++++++++++++++++++---------------------
 lib/libc/time/tz-art.htm   |   4 +-
 lib/libc/time/tz-link.htm  |   7 ++---
 lib/libc/time/tzselect.ksh |  18 ++++++------
 6 files changed, 109 insertions(+), 51 deletions(-)

diffs (truncated from 370 to 300 lines):

diff -r 706aada59413 -r c702f5f1dfca lib/libc/time/Makefile
--- a/lib/libc/time/Makefile    Sat Jan 31 18:27:28 2015 +0000
+++ b/lib/libc/time/Makefile    Sat Jan 31 18:55:17 2015 +0000
@@ -5,7 +5,7 @@
 PACKAGE=       tzcode
 
 # Version numbers of the code and data distributions.
-VERSION=       2014j
+VERSION=       2015a
 
 # Email address for bug reports.
 BUGEMAIL=      tz%iana.org@localhost
@@ -360,7 +360,7 @@
 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)
 
@@ -469,7 +469,7 @@
                        <$? >$@
                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)
@@ -485,9 +485,9 @@
                ! grep -Env $(VALID_LINE) $(ENCHILADA)
 
 check_white_space: $(ENCHILADA)
-               ! grep -n ' '$(TAB_CHAR) $(ENCHILADA)
-               ! grep -n '[[:space:]]$$' $(ENCHILADA)
-               ! grep -n "$$(printf '[\f\r\v]\n')" $(ENCHILADA)
+               ! grep -En ' '$(TAB_CHAR)"|$$(printf '[\f\r\v]')" $(ENCHILADA)
+               ! grep -n '[[:space:]]$$' \
+                       $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
 
 CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
 
@@ -501,6 +501,9 @@
                $(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) \
@@ -663,7 +666,8 @@
 .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
diff -r 706aada59413 -r c702f5f1dfca lib/libc/time/NEWS
--- a/lib/libc/time/NEWS        Sat Jan 31 18:27:28 2015 +0000
+++ b/lib/libc/time/NEWS        Sat Jan 31 18:55:17 2015 +0000
@@ -1,5 +1,57 @@
 News for the tz database
 
+Release 2015a - 2015-01-29 22:35:20 -0800
+
+  Changes affecting future time stamps
+
+    The Mexican state of Quintana Roo, represented by America/Cancun,
+    will shift from Central Time with DST to Eastern Time without DST
+    on 2015-02-01 at 02:00.  (Thanks to Steffen Thorsen and Gwillim Law.)
+
+    Chile will not change clocks in April or thereafter; its new standard time
+    will be its old daylight saving time.  This affects America/Santiago,
+    Pacific/Easter, and Antarctica/Palmer.  (Thanks to Juan Correa.)
+
+    New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
+    (Thanks to Tim Parenti.)
+
+  Changes affecting past time stamps
+
+    Iceland observed DST in 1919 and 1921, and its 1939 fallback
+    transition was Oct. 29, not Nov. 29.  Remove incorrect data from
+    Shanks about time in Iceland between 1837 and 1908.
+
+    Some more zones have been turned into links, when they differed
+    from existing zones only for older time stamps.  As usual,
+    these changes affect UTC offsets in pre-1970 time stamps only.
+    Their old contents have been moved to the 'backzone' file.
+    The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
+    and Asia/Muscat.
+
+  Changes affecting code
+
+    tzalloc now scrubs time zone abbreviations compatibly with the way
+    that tzset always has, by replacing invalid bytes with '_' and by
+    shortening too-long abbreviations.
+
+    tzselect ports to POSIX awk implementations, no longer mishandles
+    POSIX TZ settings when GNU awk is used, and reports POSIX TZ
+    settings to the user.  (Thanks to Stefan Kuhn.)
+
+  Changes affecting build procedure
+
+    'make check' now checks for links to links in the data.
+    One such link (for Africa/Asmera) has been fixed.
+    (Thanks to Stephen Colebourne for pointing out the problem.)
+
+  Changes affecting commentary
+
+    The leapseconds file commentary now mentions the expiration date.
+    (Problem reported by Martin Burnicki.)
+
+    Update Mexican Library of Congress URL.
+
+
 Release 2014j - 2014-11-10 17:37:11 -0800
 
   Changes affecting current and future time stamps
diff -r 706aada59413 -r c702f5f1dfca lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Sat Jan 31 18:27:28 2015 +0000
+++ b/lib/libc/time/localtime.c Sat Jan 31 18:55:17 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localtime.c,v 1.92 2014/11/11 18:46:54 christos Exp $  */
+/*     $NetBSD: localtime.c,v 1.93 2015/01/31 18:55:17 christos Exp $  */
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char    elsieid[] = "@(#)localtime.c    8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.92 2014/11/11 18:46:54 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.93 2015/01/31 18:55:17 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -266,12 +266,11 @@
 }
 
 static void
-settzname_z(timezone_t sp)
+scrub_abbrs(struct state *sp)
 {
-       int                     i;
+       int i;
 
        /*
-       ** Scrub the abbreviations.
        ** First, replace bogus characters.
        */
        for (i = 0; i < sp->charcnt; ++i)
@@ -290,25 +289,18 @@
        }
 }
 
-static char *
-setzone(const struct state *sp, const struct ttinfo *ttisp, int_fast32_t offset)
+static void
+update_tzname_etc(const struct state *sp, const struct ttinfo *ttisp)
 {
-       char *zn = __UNCONST(&sp->chars[ttisp->tt_abbrind]);
-       if (offset) {
+       tzname[ttisp->tt_isdst] = __UNCONST(&sp->chars[ttisp->tt_abbrind]);
 #ifdef USG_COMPAT
-               if (ttisp->tt_isdst)
-                       daylight = 1;
-               if (!ttisp->tt_isdst)
-                       timezone = -(ttisp->tt_gmtoff);
-#endif /* defined USG_COMPAT */
+       if (!ttisp->tt_isdst)
+               timezone = - ttisp->tt_gmtoff;
+#endif
 #ifdef ALTZONE
-               if (ttisp->tt_isdst)
-                       altzone = -(ttisp->tt_gmtoff);
+       if (ttisp->tt_isdst)
+           altzone = - ttisp->tt_gmtoff;
 #endif /* defined ALTZONE */
-       }
-
-       tzname[ttisp->tt_isdst] = zn;
-       return zn;
 }
 
 static void
@@ -334,9 +326,16 @@
        ** And to get the latest zone names into tzname. . .
        */
        for (i = 0; i < sp->typecnt; ++i)
-               setzone(sp, &sp->ttis[i], -1);
+               update_tzname_etc(sp, &sp->ttis[i]);
 
-       settzname_z(sp);
+       for (i = 0; i < sp->timecnt; ++i) {
+               const struct ttinfo * const ttisp = &sp->ttis[sp->types[i]];
+               update_tzname_etc(sp, ttisp);
+#ifdef USG_COMPAT
+               if (ttisp->tt_isdst)
+                       daylight = 1;
+#endif /* defined USG_COMPAT */
+       }
 }
 
 static bool
@@ -1251,7 +1250,9 @@
                int err = tzload(name, sp, true);
                if (err != 0 && name && name[0] != ':' &&
                    tzparse(name, sp, false))
-                       return 0;
+                       err = 0;
+               if (err == 0)
+                       scrub_abbrs(sp);
                return err;
        }
 }
@@ -1356,16 +1357,17 @@
 ** freely called. (And no, the PANS doesn't require the above behavior,
 ** but it *is* desirable.)
 **
-** If successful and OFFSET is nonzero,
+** If successful and SETNAME is nonzero,
 ** set the applicable parts of tzname, timezone and altzone;
 ** however, it's OK to omit this step if the time zone is POSIX-compatible,
 ** since in that case tzset should have already done this step correctly.
-** OFFSET's type is intfast32_t for compatibility with gmtsub.
+** SETNAME's type is intfast32_t for compatibility with gmtsub,
+** but it is actually a boolean and its value should be 0 or 1.
 */
 
 /*ARGSUSED*/
 static struct tm *
-localsub(struct state const *sp, time_t const *timep, int_fast32_t offset,
+localsub(struct state const *sp, time_t const *timep, int_fast32_t setname,
         struct tm *const tmp)
 {
        const struct ttinfo *   ttisp;
@@ -1397,7 +1399,7 @@
                                errno = EINVAL;
                                return NULL;    /* "cannot happen" */
                        }
-                       result = localsub(sp, &newt, offset, tmp);
+                       result = localsub(sp, &newt, setname, tmp);
                        if (result) {
                                int_fast64_t newy;
 
@@ -1437,11 +1439,12 @@
        */
        result = timesub(&t, ttisp->tt_gmtoff, sp, tmp);
        if (result) {
-               char *zn = setzone(sp, ttisp, offset);
                result->tm_isdst = ttisp->tt_isdst;
 #ifdef TM_ZONE
-               result->TM_ZONE = zn;
+               result->TM_ZONE = __UNCONST(&sp->chars[ttisp->tt_abbrind]);
 #endif /* defined TM_ZONE */
+               if (setname)
+                       update_tzname_etc(sp, ttisp);
        }
        return result;
 }
diff -r 706aada59413 -r c702f5f1dfca lib/libc/time/tz-art.htm
--- a/lib/libc/time/tz-art.htm  Sat Jan 31 18:27:28 2015 +0000
+++ b/lib/libc/time/tz-art.htm  Sat Jan 31 18:55:17 2015 +0000
@@ -330,8 +330,8 @@
 <li>
 An episode of <em>The Adventures of Superman</em> entitled "The Mysterious
 Cube," first aired 1958-02-24, had Superman convincing the controllers
-of WWV to broadcast time signals five minutes ahead of actual time;
-doing so got a crook trying to beat the statute of limitations to
+of the Arlington Time Signal to broadcast ahead of actual time;
+doing so got a crook trying to be declared dead to
 emerge a bit too early from the titular enclosure.
 </li>
 <li>
diff -r 706aada59413 -r c702f5f1dfca lib/libc/time/tz-link.htm
--- a/lib/libc/time/tz-link.htm Sat Jan 31 18:27:28 2015 +0000
+++ b/lib/libc/time/tz-link.htm Sat Jan 31 18:55:17 2015 +0000
@@ -8,7 +8,7 @@
 <meta http-equiv="Content-type" content='text/html; charset="UTF-8"'>
 <meta name="DC.Creator" content="Eggert, Paul">
 <meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2014-11-09">
+<meta name="DC.Date" content="2015-01-29">
 <meta name="DC.Description"
  content="Sources of information about time zones and daylight saving time">
 <meta name="DC.Identifier"
@@ -47,7 +47,7 @@
 <a href="https://cygwin.com";>Cygwin</a>,
 <a href="http://www.delorie.com/djgpp/";><abbr
 title="DJ's GNU Programming Platform">DJGPP</abbr></a>,
-<a href="http://en.wikipedia.org/wiki/Symbian";>Symbian</a>,
+<a href="http://en.wikipedia.org/wiki/MINIX";>MINIX</a>,
 <a href="http://en.wikipedia.org/wiki/WebOS";><abbr
 title="Web Operating System">webOS</abbr></a>,



Home | Main Index | Thread Index | Old Index