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 tzcode2018c [ changelog with changes to ...



details:   https://anonhg.NetBSD.org/src/rev/4fee2ce15e4e
branches:  trunk
changeset: 829325:4fee2ce15e4e
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 25 22:48:42 2018 +0000

description:
Merge tzcode2018c [ changelog with changes to tzdata sections removed ]

Release 2018c - 2018-01-22 23:00:44 -0800

  Changes to build procedure

    The build procedure now works around mawk 1.3.3's lack of support
    for character class expressions.  (Problem reported by Ohyama.)


Release 2018b - 2018-01-17 23:24:48 -0800

  Changes to build procedure

    The distribution now contains the file 'pacificnew' again.
    This file was inadvertantly omitted in the 2018a distribution.
    (Problem reported by Matias Fonzo.)


Release 2018a - 2018-01-12 22:29:21 -0800

  Changes to build procedure

    The default installation locations have been changed to mostly
    match Debian circa 2017, instead of being designed as an add-on to
    4.3BSD circa 1986.  This affects the Makefile macros TOPDIR,
    TZDIR, MANDIR, and LIBDIR.  New Makefile macros TZDEFAULT, USRDIR,
    USRSHAREDIR, BINDIR, ZDUMPDIR, and ZICDIR let installers tailor
    locations more precisely.  (This responds to suggestions from
    Brian Inglis and from Steve Summit.)

    The default installation procedure no longer creates the
    backward-compatibility link US/Pacific-New, which causes
    confusion during user setup (e.g., see Debian bug 815200).
    Use 'make BACKWARD="backward pacificnew"' to create the link
    anyway, for now.  Eventually we plan to remove the link entirely.

    tzdata.zi now contains a version-number comment.
    (Suggested by Tom Lane.)

    The Makefile now quotes values like BACKWARD more carefully when
    passing them to the shell.  (Problem reported by Zefram.)

    Builders no longer need to specify -DHAVE_SNPRINTF on platforms
    that have snprintf and use pre-C99 compilers.  (Problem reported
    by Jon Skeet.)

  Changes to code

    zic has a new option -t FILE that specifies the location of the
    file that determines local time when TZ is unset.  The default for
    this location can be configured via the new TZDEFAULT makefile
    macro, which defaults to /etc/localtime.

    Diagnostics and commentary now distinguish UT from UTC more
    carefully; see theory.html for more information about UT vs UTC.

    zic has been ported to GCC 8's -Wstringop-truncation option.
    (Problem reported by Martin Sebor.)

  Changes to documentation and commentary

    The zic man page now documents the longstanding behavior that
    times and years can be out of the usual range, with negative times
    counting backwards from midnight and with year 0 preceding year 1.
    (Problem reported by Michael Deckers.)

    The theory.html file now mentions the POSIX limit of six chars
    per abbreviation, and lists alphabetic abbreviations used.

    The files tz-art.htm and tz-link.htm have been renamed to
    tz-art.html and tz-link.html, respectively, for consistency with
    other file names and to simplify web server configuration.

diffstat:

 lib/libc/time/Makefile       |  193 ++++++++++++++++++++++++++----------------
 lib/libc/time/NEWS           |  166 ++++++++++++++++++++++++++++++++++--
 lib/libc/time/README         |    4 +-
 lib/libc/time/ctime.3        |    8 +-
 lib/libc/time/localtime.c    |    6 +-
 lib/libc/time/theory.html    |  146 +++++++++++++++++++++++---------
 lib/libc/time/tz-how-to.html |    2 +-
 lib/libc/time/tzselect.8     |    4 +-
 lib/libc/time/tzselect.ksh   |    8 +-
 lib/libc/time/tzset.3        |   26 +++--
 lib/libc/time/version        |    2 +-
 lib/libc/time/zdump.c        |   57 ++++++------
 lib/libc/time/zic.8          |  145 +++++++++++++++++++++----------
 lib/libc/time/zic.c          |   31 ++++--
 14 files changed, 559 insertions(+), 239 deletions(-)

diffs (truncated from 1690 to 300 lines):

diff -r a21e7723b7af -r 4fee2ce15e4e lib/libc/time/Makefile
--- a/lib/libc/time/Makefile    Thu Jan 25 22:37:42 2018 +0000
+++ b/lib/libc/time/Makefile    Thu Jan 25 22:48:42 2018 +0000
@@ -42,36 +42,63 @@
 # Also see TZDEFRULESTRING below, which takes effect only
 # if the time zone files cannot be accessed.
 
-# Everything gets put in subdirectories of. . .
+
+# Installation locations.
+#
+# The defaults are suitable for Debian, except that if REDO is
+# posix_right or right_posix then files that Debian puts under
+# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
+# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
+# respectively.  Problems with the Debian approach are discussed in
+# the commentary for the right_posix rule (below).
 
-TOPDIR=                /usr/local
+# Destination directory, which can be used for staging.
+# 'make DESTDIR=/stage install' installs under /stage (e.g., to
+# /stage/etc/localtime instead of to /etc/localtime).  Files under
+# /stage are not intended to work as-is, but can be copied by hand to
+# the root directory later.  If DESTDIR is empty, 'make install' does
+# not stage, but installs directly into production locations.
+DESTDIR =
+
+# Everything is installed into subdirectories of TOPDIR, and used there.
+# TOPDIR should be empty (meaning the root directory),
+# or a directory name that does not end in "/".
+# TOPDIR should be empty or an absolute name unless you're just testing.
+TOPDIR =
+
+# The default local time zone is taken from the file TZDEFAULT.
+TZDEFAULT = $(TOPDIR)/etc/localtime
+
+# The subdirectory containing installed program and data files, and
+# likewise for installed files that can be shared among architectures.
+# These should be relative file names.
+USRDIR = usr
+USRSHAREDIR = $(USRDIR)/share
 
 # "Compiled" time zone information is placed in the "TZDIR" directory
 # (and subdirectories).
-# Use an absolute path name for TZDIR unless you're just testing the software.
 # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
+TZDIR_BASENAME=        zoneinfo
+TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)
+
+# The "tzselect" and (if you do "make INSTALL") "date" commands go in:
+BINDIR = $(TOPDIR)/$(USRDIR)/bin
+
+# The "zdump" command goes in:
+ZDUMPDIR = $(BINDIR)
 
-TZDIR_BASENAME=        zoneinfo
-TZDIR=         $(TOPDIR)/etc/$(TZDIR_BASENAME)
+# The "zic" command goes in:
+ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
+
+# Manual pages go in subdirectories of. . .
+MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
+
+# Library functions are put in an archive in LIBDIR.
+LIBDIR = $(TOPDIR)/$(USRDIR)/lib
+
 
 # Types to try, as an alternative to time_t.  int64_t should be first.
-TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t
-
-# The "tzselect", "zic", and "zdump" commands get installed in. . .
-
-ETCDIR=                $(TOPDIR)/etc
-
-# If you "make INSTALL", the "date" command gets installed in. . .
-
-BINDIR=                $(TOPDIR)/bin
-
-# Manual pages go in subdirectories of. . .
-
-MANDIR=                $(TOPDIR)/man
-
-# Library functions are put in an archive in LIBDIR.
-
-LIBDIR=                $(TOPDIR)/lib
+TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
 
 # If you want only POSIX time, with time values interpreted as
 # seconds since the epoch (not counting leap seconds), use
@@ -105,11 +132,14 @@
 TZDATA_TEXT=   leapseconds tzdata.zi
 
 # For backward-compatibility links for old zone names, use
+#      BACKWARD=       backward
+# If you also want the link US/Pacific-New, even though it is confusing
+# and is planned to be removed from the database eventually, use
 #      BACKWARD=       backward pacificnew
 # To omit these links, use
 #      BACKWARD=
 
-BACKWARD=      backward pacificnew
+BACKWARD=      backward
 
 # If you want out-of-scope and often-wrong data from the file 'backzone', use
 #      PACKRATDATA=    backzone
@@ -313,7 +343,7 @@
 
 # How to use zic to install tz binary files.
 
-ZIC_INSTALL=   $(ZIC) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
+ZIC_INSTALL=   $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
 
 # The name of a Posix-compliant 'awk' on your system.
 AWK=           awk
@@ -341,8 +371,8 @@
 VALIDATE = nsgmls
 VALIDATE_FLAGS = -s -B -wall -wno-unused-param
 VALIDATE_ENV = \
-  SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
-  SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
+  SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
+  SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
   SP_CHARSET_FIXED=YES \
   SP_ENCODING=UTF-8
 
@@ -396,7 +426,7 @@
 #MAKE=         make
 
 cc=            cc
-CC=            $(cc) -DTZDIR=\"$(TZDIR)\"
+CC=            $(cc) -DTZDIR='"$(TZDIR)"'
 
 AR=            ar
 
@@ -421,18 +451,19 @@
                        date.1.txt
 COMMON=                calendars CONTRIBUTING LICENSE Makefile \
                        NEWS README theory.html version
-WEB_PAGES=     tz-art.htm tz-how-to.html tz-link.htm
+WEB_PAGES=     tz-art.html tz-how-to.html tz-link.html
 DOCS=          $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
 PRIMARY_YDATA= africa antarctica asia australasia \
                europe northamerica southamerica
-YDATA=         $(PRIMARY_YDATA) etcetera $(BACKWARD)
+YDATA=         $(PRIMARY_YDATA) etcetera
 NDATA=         systemv factory
-TDATA=         $(YDATA) $(NDATA)
+TDATA_TO_CHECK=        $(YDATA) $(NDATA) backward pacificnew
+TDATA=         $(YDATA) $(NDATA) $(BACKWARD)
 ZONETABLES=    zone1970.tab zone.tab
 TABDATA=       iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
 LEAP_DEPS=     leapseconds.awk leap-seconds.list
-TZDATA_ZI_DEPS=        zishrink.awk $(TDATA) $(PACKRATDATA)
-DATA=          $(YDATA) $(NDATA) backzone iso3166.tab leap-seconds.list \
+TZDATA_ZI_DEPS=        zishrink.awk version $(TDATA) $(PACKRATDATA)
+DATA=          $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
                        leapseconds yearistype.sh $(ZONETABLES)
 AWK_SCRIPTS=   checklinks.awk checktab.awk leapseconds.awk zishrink.awk
 MISC=          $(AWK_SCRIPTS) zoneinfo2tdf.pl
@@ -457,7 +488,7 @@
                newctime.3 newstrftime.3 newtzset.3 northamerica \
                pacificnew private.h \
                southamerica strftime.c systemv theory.html \
-               time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \
+               time2posix.3 tz-art.html tz-how-to.html tz-link.html \
                tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
                workman.sh yearistype.sh \
                zdump.8 zdump.c zic.8 zic.c \
@@ -473,35 +504,41 @@
 ALL:           all date $(ENCHILADA)
 
 install:       all $(DATA) $(REDO) $(MANS)
-               mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
-                       $(DESTDIR)$(LIBDIR) \
-                       $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
-                       $(DESTDIR)$(MANDIR)/man8
-               $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES)
-               cp -f $(TABDATA) $(DESTDIR)$(TZDIR)/.
-               cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
-               cp libtz.a $(DESTDIR)$(LIBDIR)/.
-               $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
-               cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
-               cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
-               cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
+               mkdir -p '$(DESTDIR)$(BINDIR)' \
+                       '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
+                       '$(DESTDIR)$(LIBDIR)' \
+                       '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
+                       '$(DESTDIR)$(MANDIR)/man8'
+               $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
+                       -t '$(DESTDIR)$(TZDEFAULT)'
+               cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
+               cp tzselect '$(DESTDIR)$(BINDIR)/.'
+               cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
+               cp zic '$(DESTDIR)$(ZICDIR)/.'
+               cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
+               $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
+               cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
+               cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
+               cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
 
 INSTALL:       ALL install date.1
-               mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
-               cp date $(DESTDIR)$(BINDIR)/.
-               cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
+               mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
+               cp date '$(DESTDIR)$(BINDIR)/.'
+               cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
 
 version:       $(VERSION_DEPS)
                { (type git) >/dev/null 2>&1 && \
                  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
                                --abbrev=7 --dirty` || \
-                 V=$(VERSION); } && \
+                 V='$(VERSION)'; } && \
                printf '%s\n' "$$V" >$@.out
                mv $@.out $@
 
 # This file can be tailored by setting BACKWARD, PACKRATDATA, etc.
 tzdata.zi:     $(TZDATA_ZI_DEPS)
-               LC_ALL=C $(AWK) -f zishrink.awk $(TDATA) $(PACKRATDATA) >$@.out
+               version=`sed 1q version` && \
+                 LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
+                   $(TDATA) $(PACKRATDATA) >$@.out
                mv $@.out $@
 
 version.h:     version
@@ -529,12 +566,13 @@
 # Arguments to pass to submakes of install_data.
 # They can be overridden by later submake arguments.
 INSTALLARGS = \
- BACKWARD=$(BACKWARD) \
- DESTDIR=$(DESTDIR) \
+ BACKWARD='$(BACKWARD)' \
+ DESTDIR='$(DESTDIR)' \
  LEAPSECONDS='$(LEAPSECONDS)' \
  PACKRATDATA='$(PACKRATDATA)' \
- TZDIR=$(TZDIR) \
- YEARISTYPE=$(YEARISTYPE) \
+ TZDEFAULT='$(TZDEFAULT)' \
+ TZDIR='$(TZDIR)' \
+ YEARISTYPE='$(YEARISTYPE)' \
  ZIC='$(ZIC)'
 
 # 'make install_data' installs one set of tz binary files.
@@ -558,16 +596,16 @@
 # You must replace all of $(TZDIR) to switch from not using leap seconds
 # to using them, or vice versa.
 right_posix:   right_only
-               rm -fr $(DESTDIR)$(TZDIR)-leaps
-               ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
-                 $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
-               $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
+               rm -fr '$(DESTDIR)$(TZDIR)-leaps'
+               ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
+                 $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
+               $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
 
 posix_right:   posix_only
-               rm -fr $(DESTDIR)$(TZDIR)-posix
-               ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
-                 $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
-               $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
+               rm -fr '$(DESTDIR)$(TZDIR)-posix'
+               ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
+                 $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
+               $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
 
 # This obsolescent rule is present for backwards compatibility with
 # tz releases 2014g through 2015g.  It should go away eventually.
@@ -633,7 +671,7 @@
                        $(MISC) $(SOURCES) $(WEB_PAGES) \
                        CONTRIBUTING LICENSE Makefile README \
                        version tzdata.zi && \
-               ! grep -Env $(SAFE_SHARP_LINE) $(TDATA) backzone \
+               ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
                        leapseconds yearistype.sh zone.tab && \
                ! grep -Env $(OK_LINE) $(ENCHILADA); \
        }
@@ -641,14 +679,16 @@
 check_white_space: $(ENCHILADA)
                patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
                ! grep -En "$$pat" $(ENCHILADA)
-               ! grep -n '[[:space:]]$$' $(ENCHILADA)
+               ! grep -n '[[:space:]]$$' \
+                       $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
 
 PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
 FILE_NAME_COMPONENT_TOO_LONG = \
   $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}
 
-check_name_lengths: $(TDATA) backzone
-               ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' $(TDATA) backzone
+check_name_lengths: $(TDATA_TO_CHECK) backzone
+               ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
+                       $(TDATA_TO_CHECK) backzone
 
 CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
 
@@ -662,8 +702,8 @@



Home | Main Index | Thread Index | Old Index