Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time update to tzcode2013a
details: https://anonhg.NetBSD.org/src/rev/d6b40791d0c6
branches: trunk
changeset: 785191:d6b40791d0c6
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 02 21:24:28 2013 +0000
description:
update to tzcode2013a
diffstat:
lib/libc/time/Makefile | 90 ++++++++++++++-----
lib/libc/time/localtime.c | 26 ++++-
lib/libc/time/strftime.c | 8 +-
lib/libc/time/tz-art.htm | 7 +
lib/libc/time/tz-link.htm | 202 ++++++++++++++++++--------------------------
lib/libc/time/tzfile.5 | 4 +-
lib/libc/time/tzselect.ksh | 51 +++++------
lib/libc/time/zdump.c | 10 +-
lib/libc/time/zic.c | 20 ++--
9 files changed, 219 insertions(+), 199 deletions(-)
diffs (truncated from 951 to 300 lines):
diff -r 0dba682a941d -r d6b40791d0c6 lib/libc/time/Makefile
--- a/lib/libc/time/Makefile Sat Mar 02 18:37:19 2013 +0000
+++ b/lib/libc/time/Makefile Sat Mar 02 21:24:28 2013 +0000
@@ -3,7 +3,10 @@
# 2009-05-17 by Arthur David Olson.
# Version numbers of the code and data distributions.
-VERSION = 2012h
+VERSION = 2013a
+
+# Email address for bug reports.
+BUGEMAIL= tz%iana.org@localhost
# 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).
@@ -226,19 +229,25 @@
CFLAGS=
-# If you want zic's -s option used when installing, uncomment the next line
-# ZFLAGS= -s
+# Linker flags. Default to $(LFLAGS) for backwards compatibility
+# to tzcode2012h and earlier.
+
+LDFLAGS= $(LFLAGS)
zic= ./zic
ZIC= $(zic) $(ZFLAGS)
# The name of a Posix-compliant `awk' on your system.
-AWK= nawk
+AWK= awk
+
+# The full path name of a Posix-compliant shell that supports the Korn shell's
+# 'select' statement, as an extension. These days, Bash is the most popular.
+KSHELL= /bin/bash
# The path where SGML DTDs are kept.
-# The default is appropriate for Ubuntu.
-SGML_TOPDIR= /usr
-SGML_SEARCH_PATH= $(SGML_TOPDIR)/share/xml/xhtml/schema/dtd/REC-html401-19991224
+# The default is appropriate for Ubuntu 12.10.
+SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
+SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
# The catalog file(s) to use when validating.
SGML_CATALOG_FILES= HTML4.cat
@@ -254,6 +263,17 @@
SP_CHARSET_FIXED=YES \
SP_ENCODING=UTF-8
+# INVALID_CHAR is a regular expression that matches invalid characters in
+# distributed files. For now, stick to a safe subset of ASCII.
+# The caller must set the shell variable 'sharp' to the character '#',
+# since Makefile macros cannot contain '#'.
+# TAB_CHAR is a single tab character, in single quotes.
+TAB_CHAR= ' '
+INVALID_CHAR1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
+INVALID_CHAR2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
+INVALID_CHAR3= 'abcdefghijklmnopqrstuvwxyz{|}~'
+INVALID_CHAR= '[^]'$(INVALID_CHAR1)$(INVALID_CHAR2)$(INVALID_CHAR3)'-]'
+
# 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
@@ -336,14 +356,15 @@
cp date.1 $(MANDIR)/man1/.
version.h:
- echo >$@ \
- 'static char const TZVERSION[]="tz$(VERSION)";'
+ (echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
+ echo 'static char const TZVERSION[]="$(VERSION)";' && \
+ echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@
zdump: $(TZDOBJS)
- $(CC) $(CFLAGS) $(LFLAGS) $(TZDOBJS) $(LDLIBS) -o $@
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
zic: $(TZCOBJS) yearistype
- $(CC) $(CFLAGS) $(LFLAGS) $(TZCOBJS) $(LDLIBS) -o $@
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
yearistype: yearistype.sh
cp yearistype.sh yearistype
@@ -378,22 +399,27 @@
$(TZLIB): $(LIBOBJS)
-mkdir $(TOPDIR) $(LIBDIR)
ar ru $@ $(LIBOBJS)
- if [ -x /usr/ucb/ranlib -o -x /usr/bin/ranlib ] ; \
+ if [ -x /usr/ucb/ranlib ] || [ -x /usr/bin/ranlib ]; \
then ranlib $@ ; fi
date: $(DATEOBJS)
- $(CC) $(CFLAGS) date.o localtime.o asctime.o strftime.o \
- $(LDLIBS) -lc -o $@
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
tzselect: tzselect.ksh
sed \
+ -e 's|#!/bin/bash|#!$(KSHELL)|g' \
-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
+ -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
+ -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
- -e 's|\(TZVERSION\)=.*|\1=tz$(VERSION)|' \
+ -e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
<$? >$@
chmod +x $@
-check: check_tables check_web
+check: check_character_set check_tables check_web
+
+check_character_set: $(ENCHILADA)
+ sharp='#'; ! grep -n $(INVALID_CHAR) $(ENCHILADA)
check_tables: checktab.awk $(PRIMARY_YDATA)
$(AWK) -f checktab.awk $(PRIMARY_YDATA)
@@ -404,15 +430,18 @@
clean:
rm -f core *.o *.out \
date tzselect version.h zdump zic yearistype
+ rm -f -r tzpublic
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 *.asc *.tar.gz
names:
@echo $(ENCHILADA)
+public: check check_public set-timestamps tarballs signatures
+
# 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',
@@ -432,14 +461,19 @@
# 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) set-timestamps
+check_public: $(ENCHILADA)
make maintainer-clean
make "CFLAGS=$(GCC_DEBUG_FLAGS)"
- 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
+ mkdir tzpublic
+ for i in $(TDATA) ; do \
+ $(zic) -v -d tzpublic $$i 2>&1 || exit; \
+ done
+ $(zic) -v -d tzpublic $(TDATA)
+ rm -f -r tzpublic
+
+tarballs: tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
+
+tzcode$(VERSION).tar.gz: $(COMMON) $(DOCS) $(SOURCES) $(MISC)
for i in *.[1-8] ; do \
LC_ALL=C sh workman.sh $$i > $$i.txt && \
touch -r $$i $$i.txt || exit; \
@@ -451,7 +485,15 @@
gzip $(GZIPFLAGS) > tzcode$(VERSION).tar.gz
LC_ALL=C && export LC_ALL && \
tar $(TARFLAGS) -cf - $(COMMON) $(DATA) | \
- gzip $(GZIPFLAGS) > tzdata$(VERSION).tar.gz
+ gzip $(GZIPFLAGS) > $@
+
+signatures: tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc
+
+tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
+ gpg --armor --detach-sign $?
+
+tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
+ gpg --armor --detach-sign $?
typecheck:
make clean
diff -r 0dba682a941d -r d6b40791d0c6 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Sat Mar 02 18:37:19 2013 +0000
+++ b/lib/libc/time/localtime.c Sat Mar 02 21:24:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: localtime.c,v 1.72 2012/10/28 19:02:29 christos Exp $ */
+/* $NetBSD: localtime.c,v 1.73 2013/03/02 21:24:28 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.72 2012/10/28 19:02:29 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.73 2013/03/02 21:24:28 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -337,8 +337,7 @@
for (i = 0; i < sp->typecnt; ++i) {
const struct ttinfo * const ttisp = &sp->ttis[i];
- tzname[ttisp->tt_isdst] =
- &sp->chars[ttisp->tt_abbrind];
+ tzname[ttisp->tt_isdst] = &sp->chars[ttisp->tt_abbrind];
#ifdef USG_COMPAT
if (ttisp->tt_isdst)
daylight = 1;
@@ -523,20 +522,31 @@
** signed time_t system but using a data file with
** unsigned values (or vice versa).
*/
- for (i = 0; i < sp->timecnt - 2; ++i)
- if (sp->ats[i] > sp->ats[i + 1]) {
- ++i;
+ for (i = 0; i < sp->timecnt; ++i)
+ if ((i < sp->timecnt - 1 &&
+ sp->ats[i] > sp->ats[i + 1]) ||
+ (i == sp->timecnt - 1 && !TYPE_SIGNED(time_t) &&
+ sp->ats[i] >
+ ((stored == 4) ? INT32_MAX : INT64_MAX))) {
if (TYPE_SIGNED(time_t)) {
/*
** Ignore the end (easy).
*/
- sp->timecnt = i;
+ sp->timecnt = i + 1;
} else {
/*
** Ignore the beginning (harder).
*/
int j;
+ /*
+ ** Keep the record right before the
+ ** epoch boundary,
+ ** but tweak it so that it starts
+ ** right with the epoch
+ ** (thanks to Doug Bailey).
+ */
+ sp->ats[i] = 0;
for (j = 0; j + i < sp->timecnt; ++j) {
sp->ats[j] = sp->ats[j + i];
sp->types[j] = sp->types[j + i];
diff -r 0dba682a941d -r d6b40791d0c6 lib/libc/time/strftime.c
--- a/lib/libc/time/strftime.c Sat Mar 02 18:37:19 2013 +0000
+++ b/lib/libc/time/strftime.c Sat Mar 02 21:24:28 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: strftime.c,v 1.23 2012/10/24 00:10:03 christos Exp $ */
+/* $NetBSD: strftime.c,v 1.24 2013/03/02 21:24:28 christos Exp $ */
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
@@ -6,14 +6,16 @@
static char elsieid[] = "@(#)strftime.c 7.64";
static char elsieid[] = "@(#)strftime.c 8.3";
#else
-__RCSID("$NetBSD: strftime.c,v 1.23 2012/10/24 00:10:03 christos Exp $");
+__RCSID("$NetBSD: strftime.c,v 1.24 2013/03/02 21:24:28 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
/*
-** Based on the UCB version with the ID appearing below.
+** Based on the UCB version with the copyright notice and sccsid
+** appearing below.
+**
** This is ANSIish only when "multibyte character == plain character".
*/
diff -r 0dba682a941d -r d6b40791d0c6 lib/libc/time/tz-art.htm
--- a/lib/libc/time/tz-art.htm Sat Mar 02 18:37:19 2013 +0000
+++ b/lib/libc/time/tz-art.htm Sat Mar 02 21:24:28 2013 +0000
@@ -415,6 +415,13 @@
</a>. (Mark Brader, 2009-10-02)
</li>
<li>
+In the "Run by the Monkeys" episode of "Da Vinci's Inquest"
+(first broadcast 2002-11-17),
+a witness in a five-year-old fire case realizes they may not have set
+their clock back when daylight saving ended on the day of the fire,
+introducing the possibility of an hour when arson might have occurred.
+</li>
+<li>
In "The Todd Couple" episode of "Outsourced" (first aired 2011-02-10),
Manmeet sets up teledates for 6:00 and 9:00;
since one is with a New Yorker and the other with a San Franciscan,
diff -r 0dba682a941d -r d6b40791d0c6 lib/libc/time/tz-link.htm
--- a/lib/libc/time/tz-link.htm Sat Mar 02 18:37:19 2013 +0000
+++ b/lib/libc/time/tz-link.htm Sat Mar 02 21:24:28 2013 +0000
@@ -8,10 +8,11 @@
<meta http-equiv="Content-type" content='text/html; charset="US-ASCII"'>
<meta name="DC.Creator" content="Eggert, Paul">
<meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2012-07-19">
+<meta name="DC.Date" content="2013-02-21">
<meta name="DC.Description"
Home |
Main Index |
Thread Index |
Old Index