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 2012e



details:   https://anonhg.NetBSD.org/src/rev/711668db049e
branches:  trunk
changeset: 780849:711668db049e
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 09 12:38:25 2012 +0000

description:
merge 2012e

diffstat:

 lib/libc/time/Makefile     |  65 ++++++++++++++++++++++++++++++++++++++-------
 lib/libc/time/README       |  21 +++++++++----
 lib/libc/time/Theory       |  32 ++++++++++------------
 lib/libc/time/checktab.awk |   4 +--
 lib/libc/time/private.h    |  14 +---------
 lib/libc/time/tz-art.htm   |   5 +--
 lib/libc/time/tz-link.htm  |  43 +++++++++++++++++++-----------
 lib/libc/time/tzfile.5     |   3 +-
 lib/libc/time/tzfile.h     |  14 +---------
 lib/libc/time/tzselect.ksh |   6 ++--
 lib/libc/time/version.h    |   1 +
 lib/libc/time/zdump.8      |   3 +-
 lib/libc/time/zdump.c      |  11 ++----
 lib/libc/time/zic.8        |   3 +-
 lib/libc/time/zic.c        |   9 ++---
 15 files changed, 130 insertions(+), 104 deletions(-)

diffs (truncated from 562 to 300 lines):

diff -r f719321291ec -r 711668db049e lib/libc/time/Makefile
--- a/lib/libc/time/Makefile    Thu Aug 09 11:05:59 2012 +0000
+++ b/lib/libc/time/Makefile    Thu Aug 09 12:38:25 2012 +0000
@@ -1,8 +1,10 @@
 # <pre>
-# @(#)Makefile 8.11
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
+# Version numbers of the code and data distributions.
+VERSION = 2012e
+
 # Change the line below for your time zone (after finding the zone you want in
 # the time zone files, or adding it to a time zone file).
 # Alternately, if you discover you've got the wrong time zone, you can just
@@ -226,7 +228,9 @@
 AWK=           nawk
 
 # The path where SGML DTDs are kept.
-SGML_SEARCH_PATH= $(TOPDIR)/share/doc/sgml-lib/REC-html401-19991224/
+# The default is appropriate for Ubuntu.
+SGML_TOPDIR= /usr
+SGML_SEARCH_PATH= $(SGML_TOPDIR)/share/xml/xhtml/schema/dtd/REC-html401-19991224
 
 # The catalog file(s) to use when validating.
 SGML_CATALOG_FILES= HTML4.cat
@@ -242,6 +246,17 @@
   SP_CHARSET_FIXED=YES \
   SP_ENCODING=UTF-8
 
+# Flags to give 'tar' when making a distribution.
+# Try to use flags appropriate for GNU tar.
+GNUTARFLAGS=   --numeric-owner --owner=0 --group=0 --mode=go+u,go-w
+TARFLAGS=      `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
+                then echo $(GNUTARFLAGS); \
+                else :; \
+                fi`
+
+# Flags to give 'gzip' when making a distribution.
+GZIPFLAGS=     -9n
+
 ###############################################################################
 
 cc=            cc
@@ -311,6 +326,10 @@
                -rm -f $(MANDIR)/man1/date.1
                cp date.1 $(MANDIR)/man1/.
 
+version.h:
+               echo >$@ \
+                 'static char const TZVERSION[]="tz$(VERSION)";'
+
 zdump:         $(TZDOBJS)
                $(CC) $(CFLAGS) $(LFLAGS) $(TZDOBJS) $(LDLIBS) -o $@
 
@@ -361,6 +380,7 @@
                sed \
                        -e 's|AWK=[^}]*|AWK=$(AWK)|g' \
                        -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
+                       -e 's|\(TZVERSION\)=.*|\1=tz$(VERSION)|' \
                        <$? >$@
                chmod +x $@
 
@@ -373,31 +393,55 @@
                $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)
 
 clean:
-               rm -f core *.o *.out tzselect zdump zic yearistype date
+               rm -f core *.o *.out \
+                 date tzselect version.h zdump zic yearistype
 
 maintainer-clean: clean
                @echo 'This command is intended for maintainers to use; it'
                @echo 'deletes files that may need special tools to rebuild.'
-               rm -f *.[1-8].txt tzcode.tar.gz tzdata.tar.gz
+               rm -f *.[1-8].txt tzcode*.tar.gz tzdata*.tar.gz
 
 names:
                @echo $(ENCHILADA)
 
+# Set the time stamps to those of the git repository, if available,
+# and if the files have not changed since then.
+# This uses GNU 'touch' syntax 'touch -d@N FILE',
+# where N is the number of seconds since 1970.
+# If git or GNU 'touch' is absent, do nothing.
+set-timestamps:
+               -TZ=UTC0 && export TZ && files=`git ls-files` && \
+               touch -d @1 test.out && rm -f test.out && \
+               for file in $$files; do \
+                 test -z "`git diff --name-only $$file`" || continue; \
+                 cmd="touch -d @`git log -1 --format='format:%ct' $$file \
+                       ` $$file" && \
+                 echo "$$cmd" && \
+                 $$cmd || exit; \
+               done
+
 # The zics below ensure that each data file can stand on its own.
 # We also do an all-files run to catch links to links.
 
-public:                $(ENCHILADA)
+public:                $(ENCHILADA) set-timestamps
                make maintainer-clean
                make "CFLAGS=$(GCC_DEBUG_FLAGS)"
-               -mkdir /tmp/,tzpublic
+               mkdir -m go-rwx /tmp/,tzpublic
                -for i in $(TDATA) ; do zic -v -d /tmp/,tzpublic $$i 2>&1 | grep -v "starting year" ; done
                for i in $(TDATA) ; do zic -d /tmp/,tzpublic $$i || exit; done
                zic -v -d /tmp/,tzpublic $(TDATA) || exit
                rm -f -r /tmp/,tzpublic
-               for i in *.[1-8] ; do sh workman.sh $$i > $$i.txt || exit; done
+               for i in *.[1-8] ; do \
+                 LC_ALL=C sh workman.sh $$i > $$i.txt && \
+                 touch -r $$i $$i.txt || exit; \
+               done
                $(AWK) -f checktab.awk $(PRIMARY_YDATA)
-               tar cf - $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | gzip -9 > tzcode.tar.gz
-               tar cf - $(DATA) | gzip -9 > tzdata.tar.gz
+               LC_ALL=C && export LC_ALL && \
+               tar $(TARFLAGS) -cf - $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | \
+                 gzip $(GZIPFLAGS) > tzcode$(VERSION).tar.gz
+               LC_ALL=C && export LC_ALL && \
+               tar $(TARFLAGS) -cf - $(DATA) | \
+                 gzip $(GZIPFLAGS) > tzdata$(VERSION).tar.gz
 
 typecheck:
                make clean
@@ -418,6 +462,7 @@
 localtime.o:   private.h tzfile.h
 scheck.o:      private.h
 strftime.o:    tzfile.h
-zic.o:         private.h tzfile.h
+zdump.o:       version.h
+zic.o:         private.h tzfile.h version.h
 
 .KEEP_STATE:
diff -r f719321291ec -r 711668db049e lib/libc/time/README
--- a/lib/libc/time/README      Thu Aug 09 11:05:59 2012 +0000
+++ b/lib/libc/time/README      Thu Aug 09 12:38:25 2012 +0000
@@ -1,4 +1,5 @@
-@(#)README     8.3
+README for the tz distribution
+
 This file is in the public domain, so clarified as of
 2009-05-17 by Arthur David Olson.
 
@@ -40,9 +41,9 @@
 
        mkdir tz
        cd tz
-       wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz'
-       gzip -dc tzcode*.tar.gz | tar -xf -
-       gzip -dc tzdata*.tar.gz | tar -xf -
+       wget --retr-symlinks 'ftp://ftp.iana.org/tz/tz*-latest.tar.gz'
+       gzip -dc tzcode-latest.tar.gz | tar -xf -
+       gzip -dc tzdata-latest.tar.gz | tar -xf -
 
 Be sure to read the comments in "Makefile" and make any changes needed
 to make things right for your system, especially if you are using some
@@ -71,7 +72,7 @@
 1970, and there are undoubtedly errors even for time stamps since 1970.
 If you know that the rules are different from those in a file, by all means
 feel free to change file (and please send the changed version to
-tz%elsie.nci.nih.gov@localhost for use in the future).  Europeans take note!
+tz%iana.org@localhost for use in the future).  Europeans take note!
 
 Thanks to these Timezone Caballeros who've made major contributions to the
 time conversion package:  Keith Bostic; Bob Devine; Paul Eggert; Robert Elz;
@@ -80,7 +81,13 @@
 for testing work, and to Gwillim Law for checking local mean time data.
 None of them are responsible for remaining errors.
 
-Look in the ~ftp/pub directory of elsie.nci.nih.gov
+Look in <ftp://ftp.iana.org/tz/releases/>
 for updated versions of these files.
 
-Please send comments or information to tz%elsie.nci.nih.gov@localhost.
+Please send comments or information to tz%iana.org@localhost.
+
+Postscript:  The README above is largely unmodified (aside from details
+of mailing list and ftp archive addresses) from that prepared many years
+ago by Arthur David Olson, to whom the timezone community owes the
+greatest debt of all.  Arthur is not currently maintaining this data or
+code (though he remains involved).
diff -r f719321291ec -r 711668db049e lib/libc/time/Theory
--- a/lib/libc/time/Theory      Thu Aug 09 11:05:59 2012 +0000
+++ b/lib/libc/time/Theory      Thu Aug 09 12:38:25 2012 +0000
@@ -1,5 +1,3 @@
-#      $NetBSD: Theory,v 1.10 2011/09/04 10:10:26 christos Exp $
-@(#)Theory     8.6
 This file is in the public domain, so clarified as of
 2009-05-17 by Arthur David Olson.
 
@@ -196,26 +194,26 @@
 
 ----- Scope of the tz database -----
 
-The tz database attempts to record the history and predicted future of 
-all computer-based clocks that track civil time.  To represent this 
-data, the world is partitioned into regions whose clocks all agree 
-about time stamps that occur after the somewhat-arbitrary cutoff point 
-of the POSIX Epoch (1970-01-01 00:00:00 UTC).  For each such region, 
-the database records all known clock transitions, and labels the region 
+The tz database attempts to record the history and predicted future of
+all computer-based clocks that track civil time.  To represent this
+data, the world is partitioned into regions whose clocks all agree
+about time stamps that occur after the somewhat-arbitrary cutoff point
+of the POSIX Epoch (1970-01-01 00:00:00 UTC).  For each such region,
+the database records all known clock transitions, and labels the region
 with a notable location.
 
-Clock transitions before 1970 are recorded for each such location, 
-because most POSIX-compatible systems support negative time stamps and 
+Clock transitions before 1970 are recorded for each such location,
+because most POSIX-compatible systems support negative time stamps and
 could misbehave if data were omitted for pre-1970 transitions.
-However, the database is not designed for and does not suffice for 
-applications requiring accurate handling of all past times everywhere, 
-as it would take far too much effort and guesswork to record all 
+However, the database is not designed for and does not suffice for
+applications requiring accurate handling of all past times everywhere,
+as it would take far too much effort and guesswork to record all
 details of pre-1970 civil timekeeping.
 
-As noted in the README file, the tz database is not authoritative 
+As noted in the README file, the tz database is not authoritative
 (particularly not for pre-1970 time stamps), and it surely has errors.
-Corrections are welcome and encouraged.  Users requiring authoritative 
-data should consult national standards bodies and the references cited 
+Corrections are welcome and encouraged.  Users requiring authoritative
+data should consult national standards bodies and the references cited
 in the database's comments.
 
 
@@ -314,7 +312,7 @@
 See the file `backward' for most of these older names
 (e.g. `US/Eastern' instead of `America/New_York').
 The other old-fashioned names still supported are
-+`WET', `CET', `MET', and `EET' (see the file `europe').
+`WET', `CET', `MET', and `EET' (see the file `europe').
 
 
 ----- Time zone abbreviations -----
diff -r f719321291ec -r 711668db049e lib/libc/time/checktab.awk
--- a/lib/libc/time/checktab.awk        Thu Aug 09 11:05:59 2012 +0000
+++ b/lib/libc/time/checktab.awk        Thu Aug 09 12:38:25 2012 +0000
@@ -1,9 +1,7 @@
-#      $NetBSD: checktab.awk,v 1.4 2009/12/31 22:49:16 mlelstv Exp $
+#      $NetBSD: checktab.awk,v 1.5 2012/08/09 12:38:25 christos Exp $
 
 # Check tz tables for consistency.
 
-# @(#)checktab.awk     8.1
-
 # Contributed by Paul Eggert.
 
 BEGIN {
diff -r f719321291ec -r 711668db049e lib/libc/time/private.h
--- a/lib/libc/time/private.h   Thu Aug 09 11:05:59 2012 +0000
+++ b/lib/libc/time/private.h   Thu Aug 09 12:38:25 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: private.h,v 1.25 2009/12/31 22:49:16 mlelstv Exp $     */
+/*     $NetBSD: private.h,v 1.26 2012/08/09 12:38:25 christos Exp $    */
 
 #ifndef PRIVATE_H
 #define PRIVATE_H
@@ -27,18 +27,6 @@
 ** Thank you!
 */
 
-/*
-** ID
-*/
-
-#ifndef lint
-#ifndef NOID
-#if 0
-static char    privatehid[] = "@(#)private.h   8.6";
-#endif
-#endif /* !defined NOID */
-#endif /* !defined lint */
-
 #define GRANDPARENTED  "Local time zone must be set--see zic manual page"
 
 /*
diff -r f719321291ec -r 711668db049e lib/libc/time/tz-art.htm
--- a/lib/libc/time/tz-art.htm  Thu Aug 09 11:05:59 2012 +0000
+++ b/lib/libc/time/tz-art.htm  Thu Aug 09 12:38:25 2012 +0000
@@ -8,16 +8,13 @@
 </head>
 <body>
 <h1>Time and the Arts</h1>
-<address>
-@(#)tz-art.htm 8.20
-</address>
 <p>
 This file is in the public domain, so clarified as of
 2009-05-17 by Arthur David Olson.
 </p>
 <p>
 Please send corrections to this web page to the



Home | Main Index | Thread Index | Old Index