Hello community,
here is the log from the commit of package timezone for openSUSE:Factory checked in at 2016-03-26 15:07:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/timezone (Old)
and /work/SRC/openSUSE:Factory/.timezone.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "timezone"
Changes:
--------
--- /work/SRC/openSUSE:Factory/timezone/timezone-java.changes 2016-02-16 09:18:02.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.timezone.new/timezone-java.changes 2016-03-26 15:07:50.000000000 +0100
@@ -1,0 +2,33 @@
+Wed Mar 23 23:05:32 UTC 2016 - astieger@suse.com
+
+- timezone update 2016c [boo#972433]
+ * Azerbaijan no longer observes DST (Asia/Baku)
+ * Chile reverts from permanent to seasonal DST.
+ * Correct past timestamps for Europe/Kaliningrad, Europe/Vilnius,
+ Europe/Volgograd 1989-1991
+
+-------------------------------------------------------------------
+Thu Mar 17 06:52:00 UTC 2016 - lchiquitto@suse.com
+
+- timezone update 2016b [boo#971377]
+ * New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan
+ and Ulyanovsk Oblasts, Russia, both of which will switch from
+ +03 to +04 on 2016-03-27 at 02:00 local time.
+ * New zone Asia/Barnaul for Altai Krai and Altai Republic, Russia,
+ which will switch from +06 to +07 on the same date and local time.
+ * Asia/Sakhalin moves from +10 to +11 on 2016-03-27 at 02:00.
+ * As a trial of a new system that needs less information to be made
+ up, the new zones use numeric time zone abbreviations like "+04"
+ instead of invented abbreviations like "ASTT".
+ * Haiti will not observe DST in 2016.
+ * Palestine's spring-forward transition on 2016-03-26 is at 01:00,
+ not 00:00.
+ * tzselect's diagnostics and checking, and checktab.awk's checking,
+ have been improved.
+ * tzselect now tests Julian-date TZ settings more accurately.
+ (Thanks to J William Piggott.)
+- tzcode-revert-01-8c9cb9580.patch, tzcode-revert-02-301f794f3.patch,
+ tzcode-revert-03-39fd078a6.patch: Revert some porting fixes specific
+ to MS-Windows that rewrites parts of zic touched by our patches.
+
+-------------------------------------------------------------------
timezone.changes: same change
Old:
----
tzcode2016a.tar.gz
tzcode2016a.tar.gz.asc
tzdata2016a.tar.gz
tzdata2016a.tar.gz.asc
New:
----
tzcode-revert-01-8c9cb9580.patch
tzcode-revert-02-301f794f3.patch
tzcode-revert-03-39fd078a6.patch
tzcode2016c.tar.gz
tzcode2016c.tar.gz.asc
tzdata2016c.tar.gz
tzdata2016c.tar.gz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ timezone-java.spec ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:51.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:51.000000000 +0100
@@ -25,7 +25,7 @@
Group: System/Base
# COMMON-BEGIN
# COMMON-BEGIN
-Version: 2016a
+Version: 2016c
Release: 0
Source: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz
Source1: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz
@@ -33,6 +33,9 @@
Source3: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz.asc
# http://sks.mrball.net/pks/lookup?op=get&search=0xED97E90E62AA7E34
Source4: timezone.keyring
+Patch100: tzcode-revert-01-8c9cb9580.patch
+Patch101: tzcode-revert-02-301f794f3.patch
+Patch102: tzcode-revert-03-39fd078a6.patch
Patch0: tzdata-china.diff
Patch1: tzcode-zic.diff
# PATCH-FIX-OPENSUSE bnc#845530
@@ -59,6 +62,9 @@
%setup -c -a 1
# COMMON-PREP-BEGIN
# COMMON-PREP-BEGIN
+%patch100 -p1 -R
+%patch101 -p1 -R
+%patch102 -p1 -R
%patch0 -p1
%patch1 -p1
%patch2 -p1
++++++ timezone.spec ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:51.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:51.000000000 +0100
@@ -23,7 +23,7 @@
Url: http://www.iana.org/time-zones
PreReq: filesystem, coreutils
# COMMON-BEGIN
-Version: 2016a
+Version: 2016c
Release: 0
Source: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz
Source1: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz
@@ -31,6 +31,9 @@
Source3: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz.asc
# http://sks.mrball.net/pks/lookup?op=get&search=0xED97E90E62AA7E34
Source4: timezone.keyring
+Patch100: tzcode-revert-01-8c9cb9580.patch
+Patch101: tzcode-revert-02-301f794f3.patch
+Patch102: tzcode-revert-03-39fd078a6.patch
Patch0: tzdata-china.diff
Patch1: tzcode-zic.diff
# PATCH-FIX-OPENSUSE bnc#845530
@@ -53,6 +56,9 @@
%prep
%setup -q -c -a 1
# COMMON-PREP-BEGIN
+%patch100 -p1 -R
+%patch101 -p1 -R
+%patch102 -p1 -R
%patch0 -p1
%patch1 -p1
%patch2 -p1
++++++ iso3166-uk.diff ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:51.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:51.000000000 +0100
@@ -1,8 +1,8 @@
-Index: timezone-2014i/iso3166.tab
+Index: timezone-2016b/iso3166.tab
===================================================================
---- timezone-2014i.orig/iso3166.tab
-+++ timezone-2014i/iso3166.tab
-@@ -100,7 +100,7 @@ FM Micronesia
+--- timezone-2016b.orig/iso3166.tab
++++ timezone-2016b/iso3166.tab
+@@ -99,7 +99,7 @@ FM Micronesia
FO Faroe Islands
FR France
GA Gabon
++++++ timezone-java.spec.in ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:52.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:52.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package timezone-java
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
++++++ tzcode-fromname.patch ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:52.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:52.000000000 +0100
@@ -1,8 +1,8 @@
-Index: timezone-2015d/zic.c
+Index: timezone-2016b/zic.c
===================================================================
---- timezone-2015d.orig/zic.c
-+++ timezone-2015d/zic.c
-@@ -757,7 +757,7 @@ dolink(const char *const fromfield, cons
+--- timezone-2016b.orig/zic.c
++++ timezone-2016b/zic.c
+@@ -768,7 +768,7 @@ dolink(char const *fromfield, char const
result = link(fromname, toname);
if (result != 0) {
@@ -11,7 +11,7 @@
const char *t;
char *p;
size_t dotdots = 0;
-@@ -766,10 +766,10 @@ dolink(const char *const fromfield, cons
+@@ -777,10 +777,10 @@ dolink(char const *fromfield, char const
do
t = s;
while ((s = strchr(s, '/'))
++++++ tzcode-revert-01-8c9cb9580.patch ++++++
commit 8c9cb958078b470e352a58f7f2d756544051e59b
Author: Paul Eggert
Date: Fri Feb 26 12:36:17 2016 -0800
Fix asctime_r warning with MS-Windows
Problem reported by Ian Abbott in:
http://mm.icann.org/pipermail/tz/2016-February/023291.html
* Makefile (CFLAGS): Add comment about new -D option.
* private.h (HAVE_DECL_ASCTIME_R): New macro.
(asctime_r): Depend on this, not on HAVE_POSIX_DECLS.
diff --git a/Makefile b/Makefile
index 20c2c98..5e2fb52 100644
--- a/Makefile
+++ b/Makefile
@@ -106,6 +106,7 @@ LDLIBS=
# Add the following to the end of the "CFLAGS=" line as needed.
# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
+# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r
# -DHAVE_DIRECT_H if mkdir needs (MS-Windows)
# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
# -DHAVE_GETTEXT=1 if 'gettext' works (GNU, Linux, Solaris); also see LDLIBS
diff --git a/private.h b/private.h
index e23764d..941e91b 100644
--- a/private.h
+++ b/private.h
@@ -22,6 +22,10 @@
** You can override these in your C compiler options, e.g. '-DHAVE_GETTEXT=1'.
*/
+#ifndef HAVE_DECL_ASCTIME_R
+#define HAVE_DECL_ASCTIME_R 1
+#endif
+
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif /* !defined HAVE_GETTEXT */
@@ -386,17 +390,11 @@ time_t time(time_t *);
void tzset(void);
#endif
-/*
-** Some time.h implementations don't declare asctime_r.
-** Others might define it as a macro.
-** Fix the former without affecting the latter.
-** Similarly for timezone, daylight, and altzone.
-*/
+#if !HAVE_DECL_ASCTIME_R && !defined asctime_r
+extern char *asctime_r(struct tm const *restrict, char *restrict);
+#endif
#if !HAVE_POSIX_DECLS
-# ifndef asctime_r
-extern char * asctime_r(struct tm const *restrict, char *restrict);
-# endif
# ifdef USG_COMPAT
# ifndef timezone
extern long timezone;
++++++ tzcode-revert-02-301f794f3.patch ++++++
commit 301f794f33d145b08fbf7f5247c8663d404fabb5
Author: Paul Eggert
Date: Fri Feb 26 08:58:45 2016 -0800
Fix tzname redefinition in MS-Windows
Problem reported by Ian Abbott in:
http://mm.icann.org/pipermail/tz/2016-February/023289.html
* localtime.c (tzname): Don’t define if HAVE_POSIX_DECLS,
as causes the Microsoft compiler to complain that tzname
is redeclared without dllimport.
* localtime.c, private.h (altzone): Do define even if
HAVE_POSIX_DECLS, since this is not a POSIX-specified variable.
diff --git a/localtime.c b/localtime.c
index e3bc763..276ce34 100644
--- a/localtime.c
+++ b/localtime.c
@@ -178,11 +178,6 @@ static struct state gmtmem;
static char lcl_TZname[TZ_STRLEN_MAX + 1];
static int lcl_is_set;
-char * tzname[2] = {
- (char *) wildabbr,
- (char *) wildabbr
-};
-
/*
** Section 4.12.3 of X3.159-1989 requires that
** Except for the strftime function, these functions [asctime,
@@ -193,10 +188,16 @@ char * tzname[2] = {
static struct tm tm;
-#ifdef USG_COMPAT
+#if !HAVE_POSIX_DECLS
+char * tzname[2] = {
+ (char *) wildabbr,
+ (char *) wildabbr
+};
+# ifdef USG_COMPAT
long timezone;
int daylight;
-#endif /* defined USG_COMPAT */
+# endif
+#endif
#ifdef ALTZONE
long altzone;
diff --git a/private.h b/private.h
index 6080e71..e23764d 100644
--- a/private.h
+++ b/private.h
@@ -386,8 +386,6 @@ time_t time(time_t *);
void tzset(void);
#endif
-#if !HAVE_POSIX_DECLS
-
/*
** Some time.h implementations don't declare asctime_r.
** Others might define it as a macro.
@@ -395,24 +393,24 @@ void tzset(void);
** Similarly for timezone, daylight, and altzone.
*/
-#ifndef asctime_r
+#if !HAVE_POSIX_DECLS
+# ifndef asctime_r
extern char * asctime_r(struct tm const *restrict, char *restrict);
-#endif
-
-#ifdef USG_COMPAT
-# ifndef timezone
-extern long timezone;
# endif
-# ifndef daylight
+# ifdef USG_COMPAT
+# ifndef timezone
+extern long timezone;
+# endif
+# ifndef daylight
extern int daylight;
+# endif
# endif
#endif
+
#if defined ALTZONE && !defined altzone
extern long altzone;
#endif
-#endif
-
/*
** The STD_INSPIRED functions are similar, but most also need
** declarations if time_tz is defined.
++++++ tzcode-revert-03-39fd078a6.patch ++++++
commit 39fd078a694fa762de5ae7efceca1dbfb7be94b3
Author: Paul Eggert
Date: Fri Feb 26 03:33:54 2016 -0800
Port better to MS-Windows
Problems reported by Ian Abbott in:
http://mm.icann.org/pipermail/tz/2016-February/023286.html
http://mm.icann.org/pipermail/tz/2016-February/023287.html
* Makefile (CFLAGS): Add comment about new -D options.
* date.c (environ, optarg, optind, tzname):
* private.h (asctime_r, timezone, daylight, altzone):
* strftime.c (tzname):
* zdump.c (environ, getopt, optarg, optind, tzname):
* zic.c (getopt, link, optarg, optind):
Do not declare if HAVE_POSIX_DECLS, to avoid collisions with
system declarations, which is a problem with MS-Windows
and tzname and the dllimport attribute.
* date.c, zdump.c (tzname): Do not specify size, as POSIX doesn’t.
* private.h (HAVE_POSIX_DECLS): Default to 1.
(ENOTSUP): Default to EINVAL.
* zic.c: If HAVE_DIRECT_H, include direct.h and io.h and
define a mkdir macro, for MS-Windows.
(link, symlink): Set errno to ENOTSUP in the substitutes.
(dolink): Don’t complain merely because link and/or
symlink is not supported. Be a bit more economical and robust
about checking for directories and existing destinations.
Report errno-related string on link failures.
(itsdir): Work correctly even if a directory has a timestamp that
is out of time_t range, so that stat fails with errno ==
EOVERFLOW.
(writezone): Don’t remove files we can’t stat.
diff --git a/Makefile b/Makefile
index 568f7f6..20c2c98 100644
--- a/Makefile
+++ b/Makefile
@@ -106,6 +106,7 @@ LDLIBS=
# Add the following to the end of the "CFLAGS=" line as needed.
# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
+# -DHAVE_DIRECT_H if mkdir needs (MS-Windows)
# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
# -DHAVE_GETTEXT=1 if 'gettext' works (GNU, Linux, Solaris); also see LDLIBS
# -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
@@ -116,6 +117,8 @@ LDLIBS=
# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
# This defaults to 1 if a working localtime_rz seems to be available.
# localtime_rz can make zdump significantly faster, but is nonstandard.
+# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
+# functions like 'link' or variables like 'tzname' required by POSIX
# -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
# -DHAVE_STRFTIME_L=1 if declares locale_t and strftime_l
# This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise.
diff --git a/date.c b/date.c
index 824e57d..4c11f61 100644
--- a/date.c
+++ b/date.c
@@ -42,10 +42,12 @@
#define SECSPERMIN 60
#endif /* !defined SECSPERMIN */
+#if !HAVE_POSIX_DECLS
extern char ** environ;
extern char * optarg;
extern int optind;
-extern char * tzname[2];
+extern char * tzname[];
+#endif
static int retval = EXIT_SUCCESS;
diff --git a/private.h b/private.h
index 1c176e6..6080e71 100644
--- a/private.h
+++ b/private.h
@@ -34,6 +34,10 @@
#define HAVE_LINK 1
#endif /* !defined HAVE_LINK */
+#ifndef HAVE_POSIX_DECLS
+#define HAVE_POSIX_DECLS 1
+#endif
+
#ifndef HAVE_STRDUP
#define HAVE_STRDUP 1
#endif
@@ -106,6 +110,9 @@
#ifndef ENAMETOOLONG
# define ENAMETOOLONG EINVAL
#endif
+#ifndef ENOTSUP
+# define ENOTSUP EINVAL
+#endif
#ifndef EOVERFLOW
# define EOVERFLOW EINVAL
#endif
@@ -379,6 +386,8 @@ time_t time(time_t *);
void tzset(void);
#endif
+#if !HAVE_POSIX_DECLS
+
/*
** Some time.h implementations don't declare asctime_r.
** Others might define it as a macro.
@@ -402,6 +411,8 @@ extern int daylight;
extern long altzone;
#endif
+#endif
+
/*
** The STD_INSPIRED functions are similar, but most also need
** declarations if time_tz is defined.
diff --git a/strftime.c b/strftime.c
index 7a139bd..f75f9fd 100644
--- a/strftime.c
+++ b/strftime.c
@@ -106,7 +106,9 @@ static char * _fmt(const char *, const struct tm *, char *, const char *,
int *);
static char * _yconv(int, int, bool, bool, char *, char const *);
+#if !HAVE_POSIX_DECLS
extern char * tzname[];
+#endif
#ifndef YEAR_2000_NAME
#define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS"
diff --git a/zdump.c b/zdump.c
index 063a263..64d90f6 100644
--- a/zdump.c
+++ b/zdump.c
@@ -238,12 +238,14 @@ enum { SECSPER400YEARS_FITS = SECSPERLYEAR <= INTMAX_MAX / 400 };
# define timezone_t char **
#endif
+#if !HAVE_POSIX_DECLS
extern char ** environ;
extern int getopt(int argc, char * const argv[],
const char * options);
extern char * optarg;
extern int optind;
-extern char * tzname[2];
+extern char * tzname[];
+#endif
/* The minimum and maximum finite time values. */
enum { atime_shift = CHAR_BIT * sizeof (time_t) - 2 };
diff --git a/zic.c b/zic.c
index 78ab870..0ec3359 100644
--- a/zic.c
+++ b/zic.c
@@ -22,6 +22,13 @@ typedef int_fast64_t zic_t;
#define ZIC_MAX_ABBR_LEN_WO_WARN 6
#endif /* !defined ZIC_MAX_ABBR_LEN_WO_WARN */
+#ifdef HAVE_DIRECT_H
+# include
+# include
+# undef mkdir
+# define mkdir(name, mode) _mkdir(name)
+#endif
+
#if HAVE_SYS_STAT_H
#include
#endif
@@ -87,17 +94,19 @@ struct zone {
zic_t z_untiltime;
};
+#if !HAVE_POSIX_DECLS
extern int getopt(int argc, char * const argv[],
const char * options);
extern int link(const char * fromname, const char * toname);
extern char * optarg;
extern int optind;
+#endif
#if ! HAVE_LINK
-# define link(from, to) (-1)
+# define link(from, to) (errno = ENOTSUP, -1)
#endif
#if ! HAVE_SYMLINK
-# define symlink(from, to) (-1)
+# define symlink(from, to) (errno = ENOTSUP, -1)
#endif
static void addtt(zic_t starttime, int type);
@@ -758,41 +767,47 @@ dolink(char const *fromfield, char const *tofield)
progname, fromname, e);
exit(EXIT_FAILURE);
}
- if (itsdir(toname) <= 0)
- remove(toname);
if (link(fromname, toname) != 0) {
- int result;
+ int link_errno = errno;
+ bool retry_if_link_supported = false;
- if (! mkdirs(toname))
- exit(EXIT_FAILURE);
-
- result = link(fromname, toname);
- if (result != 0) {
- const char *s = fromfield;
- const char *t;
- char *p;
- size_t dotdots = 0;
- register char * symlinkcontents = NULL;
-
- do
- t = s;
- while ((s = strchr(s, '/'))
- && ! strncmp (fromfield, tofield,
- ++s - fromfield));
-
- for (s = tofield + (t - fromfield); *s; s++)
- dotdots += *s == '/';
- symlinkcontents
- = emalloc(3 * dotdots + strlen(t) + 1);
- for (p = symlinkcontents; dotdots-- != 0; p += 3)
- memcpy(p, "../", 3);
- strcpy(p, t);
- result = symlink(symlinkcontents, toname);
- if (result == 0)
-warning(_("hard link failed, symbolic link used"));
- free(symlinkcontents);
- }
- if (result != 0) {
+ if (link_errno == ENOENT || link_errno == ENOTSUP) {
+ if (! mkdirs(toname))
+ exit(EXIT_FAILURE);
+ retry_if_link_supported = true;
+ }
+ if ((link_errno == EEXIST || link_errno == ENOTSUP)
+ && itsdir(toname) == 0
+ && (remove(toname) == 0 || errno == ENOENT))
+ retry_if_link_supported = true;
+ if (retry_if_link_supported && link_errno != ENOTSUP)
+ link_errno = link(fromname, toname) == 0 ? 0 : errno;
+ if (link_errno != 0) {
+ const char *s = fromfield;
+ const char *t;
+ char *p;
+ size_t dotdots = 0;
+ char *symlinkcontents;
+ int symlink_result;
+
+ do
+ t = s;
+ while ((s = strchr(s, '/'))
+ && strncmp(fromfield, tofield, ++s - fromfield) == 0);
+
+ for (s = tofield + (t - fromfield); *s; s++)
+ dotdots += *s == '/';
+ symlinkcontents = emalloc(3 * dotdots + strlen(t) + 1);
+ for (p = symlinkcontents; dotdots-- != 0; p += 3)
+ memcpy(p, "../", 3);
+ strcpy(p, t);
+ symlink_result = symlink(symlinkcontents, toname);
+ free(symlinkcontents);
+ if (symlink_result == 0) {
+ if (link_errno != ENOTSUP)
+ warning(_("symbolic link used because hard link failed: %s"),
+ strerror (link_errno));
+ } else {
FILE *fp, *tp;
int c;
fp = fopen(fromname, "rb");
@@ -815,8 +830,11 @@ warning(_("hard link failed, symbolic link used"));
putc(c, tp);
close_file(fp, fromname);
close_file(tp, toname);
- warning(_("link failed, copy used"));
- }
+ if (link_errno != ENOTSUP)
+ warning(_("copy used because hard link failed: %s"),
+ strerror (link_errno));
+ }
+ }
}
free(fromname);
free(toname);
@@ -863,18 +881,17 @@ itsdir(char const *name)
{
struct stat st;
int res = stat(name, &st);
- if (res != 0)
- return res;
#ifdef S_ISDIR
- return S_ISDIR(st.st_mode) != 0;
-#else
- {
+ if (res == 0)
+ return S_ISDIR(st.st_mode) != 0;
+#endif
+ if (res == 0 || errno == EOVERFLOW) {
char *nameslashdot = relname(name, ".");
- res = stat(nameslashdot, &st);
+ bool dir = stat(nameslashdot, &st) == 0 || errno == EOVERFLOW;
free(nameslashdot);
- return res == 0;
+ return dir;
}
-#endif
+ return -1;
}
/*
@@ -1685,7 +1702,7 @@ writezone(const char *const name, const char *const string, char version)
/*
** Remove old file, if any, to snap links.
*/
- if (itsdir(fullname) <= 0 && remove(fullname) != 0 && errno != ENOENT) {
+ if (itsdir(fullname) == 0 && remove(fullname) != 0 && errno != ENOENT) {
const char *e = strerror(errno);
fprintf(stderr, _("%s: Can't remove %s: %s\n"),
++++++ tzcode-zic.diff ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:52.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:52.000000000 +0100
@@ -1,8 +1,8 @@
-Index: timezone-2015d/zic.c
+Index: timezone-2016b/zic.c
===================================================================
---- timezone-2015d.orig/zic.c
-+++ timezone-2015d/zic.c
-@@ -777,8 +777,10 @@ dolink(const char *const fromfield, cons
+--- timezone-2016b.orig/zic.c
++++ timezone-2016b/zic.c
+@@ -788,8 +788,10 @@ dolink(char const *fromfield, char const
memcpy(p, "../", 3);
strcpy(p, t);
result = symlink(symlinkcontents, toname);
++++++ tzcode2016a.tar.gz -> tzcode2016c.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Makefile new/Makefile
--- old/Makefile 2016-01-27 08:30:16.000000000 +0100
+++ new/Makefile 2016-03-23 08:52:28.000000000 +0100
@@ -5,7 +5,7 @@
PACKAGE= tzcode
# Version numbers of the code and data distributions.
-VERSION= 2016a
+VERSION= 2016c
# Email address for bug reports.
BUGEMAIL= tz@iana.org
@@ -106,6 +106,8 @@
# Add the following to the end of the "CFLAGS=" line as needed.
# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
+# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r
+# -DHAVE_DIRECT_H if mkdir needs (MS-Windows)
# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
# -DHAVE_GETTEXT=1 if 'gettext' works (GNU, Linux, Solaris); also see LDLIBS
# -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
@@ -116,6 +118,8 @@
# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
# This defaults to 1 if a working localtime_rz seems to be available.
# localtime_rz can make zdump significantly faster, but is nonstandard.
+# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
+# functions like 'link' or variables like 'tzname' required by POSIX
# -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
# -DHAVE_STRFTIME_L=1 if declares locale_t and strftime_l
# This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise.
@@ -360,7 +364,7 @@
tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
date.1.txt
COMMON= CONTRIBUTING LICENSE Makefile NEWS README Theory
-WEB_PAGES= tz-art.htm tz-link.htm
+WEB_PAGES= tz-art.htm tz-how-to.html tz-link.htm
DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/NEWS new/NEWS
--- old/NEWS 2016-01-27 08:30:16.000000000 +0100
+++ new/NEWS 2016-03-23 08:52:28.000000000 +0100
@@ -1,5 +1,90 @@
News for the tz database
+Release 2016c - 2016-03-23 00:51:27 -0700
+
+ Changes affecting future time stamps
+
+ Azerbaijan no longer observes DST. (Thanks to Steffen Thorsen.)
+
+ Chile reverts from permanent to seasonal DST. (Thanks to Juan
+ Correa for the heads-up, and to Tim Parenti for corrections.)
+ Guess that future transitions are August's and May's second
+ Saturdays at 24:00 mainland time. Also, call the period from
+ 2014-09-07 through 2016-05-14 daylight saving time instead of
+ standard time, as that seems more appropriate now.
+
+ Changes affecting past time stamps
+
+ Europe/Kaliningrad and Europe/Vilnius changed from +03/+04 to
+ +02/+03 on 1989-03-26, not 1991-03-31. Europe/Volgograd changed
+ from +04/+05 to +03/+04 on 1988-03-27, not 1989-03-26.
+ (Thanks to Stepan Golosunov.)
+
+ Changes to commentary
+
+ Several updates and URLs for historical and proposed Russian changes.
+ (Thanks to Stepan Golosunov, Matt Johnson, and Alexander Krivenyshev.)
+
+
+Release 2016b - 2016-03-12 17:30:14 -0800
+
+ Changes affecting future time stamps
+
+ New zones Europe/Astrakhan and Europe/Ulyanovsk for Astrakhan and
+ Ulyanovsk Oblasts, Russia, both of which will switch from +03 to +04 on
+ 2016-03-27 at 02:00 local time. They need distinct zones since their
+ post-1970 histories disagree. New zone Asia/Barnaul for Altai Krai and
+ Altai Republic, Russia, which will switch from +06 to +07 on the same date
+ and local time. The Astrakhan change is already official; the others have
+ passed the first reading in the State Duma and are extremely likely.
+ Also, Asia/Sakhalin moves from +10 to +11 on 2016-03-27 at 02:00.
+ (Thanks to Alexander Krivenyshev for the heads-up, and to Matt Johnson
+ and Stepan Golosunov for followup.)
+
+ As a trial of a new system that needs less information to be made up,
+ the new zones use numeric time zone abbreviations like "+04"
+ instead of invented abbreviations like "ASTT".
+
+ Haiti will not observe DST in 2016. (Thanks to Jean Antoine via
+ Steffen Thorsen.)
+
+ Palestine's spring-forward transition on 2016-03-26 is at 01:00, not 00:00.
+ (Thanks to Hannah Kreitem.) Guess future transitions will be March's last
+ Saturday at 01:00, not March's last Friday at 24:00.
+
+ Changes affecting past time stamps
+
+ Europe/Chisinau observed DST during 1990, and switched from +04 to
+ +03 at 1990-05-06 02:00, instead of switching from +03 to +02.
+ (Thanks to Stepan Golosunov.)
+
+ 1991 abbreviations in Europe/Samara should be SAMT/SAMST, not
+ KUYT/KUYST. (Thanks to Stepan Golosunov.)
+
+ Changes to code
+
+ tzselect's diagnostics and checking, and checktab.awk's checking,
+ have been improved. (Thanks to J William Piggott.)
+
+ tzcode now builds under MinGW. (Thanks to Ian Abbott and Esben Haabendal.)
+
+ tzselect now tests Julian-date TZ settings more accurately.
+ (Thanks to J William Piggott.)
+
+ Changes to commentary
+
+ Comments in zone tables have been improved. (Thanks to J William Piggott.)
+
+ tzselect again limits its menu comments so that menus fit on a
+ 24x80 alphanumeric display.
+
+ A new web page tz-how-to.html. (Thanks to Bill Seymour.)
+
+ In the Theory file, the description of possible time zone abbreviations in
+ tzdata has been cleaned up, as the old description was unclear and
+ inconsistent. (Thanks to Alain Mouette for reporting the problem.)
+
+
Release 2016a - 2016-01-26 23:28:02 -0800
Changes affecting future time stamps
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Theory new/Theory
--- old/Theory 2016-01-12 01:21:15.000000000 +0100
+++ new/Theory 2016-02-14 21:36:54.000000000 +0100
@@ -173,7 +173,7 @@
Here are the general rules used for choosing time zone abbreviations,
in decreasing order of importance:
- Use abbreviations that consist of three or more ASCII letters.
+ Use three or more characters that are ASCII alphanumerics or '+' or '-'.
Previous editions of this database also used characters like
' ' and '?', but these characters have a special meaning to
the shell and cause commands like
@@ -181,19 +181,16 @@
to have unexpected effects.
Previous editions of this rule required upper-case letters,
but the Congressman who introduced Chamorro Standard Time
- preferred "ChST", so the rule has been relaxed.
-
- This rule guarantees that all abbreviations could have
- been specified by a POSIX TZ string. POSIX
- requires at least three characters for an
- abbreviation. POSIX through 2000 says that an abbreviation
- cannot start with ':', and cannot contain ',', '-',
- '+', NUL, or a digit. POSIX from 2001 on changes this
- rule to say that an abbreviation can contain only '-', '+',
+ preferred "ChST", so lower-case letters are now allowed.
+ Also, POSIX from 2001 on relaxed the rule to allow '-', '+',
and alphanumeric characters from the portable character set
- in the current locale. To be portable to both sets of
- rules, an abbreviation must therefore use only ASCII
- letters.
+ in the current locale. In practice ASCII alphanumerics and
+ '+' and '-' are safe in all locales.
+
+ In other words, in the C locale the POSIX extended regular
+ expression [-+[:alnum:]]{3,} should match the abbreviation.
+ This guarantees that all abbreviations could have been
+ specified by a POSIX TZ string.
Use abbreviations that are in common use among English-speakers,
e.g. 'EST' for Eastern Standard Time in North America.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/date.c new/date.c
--- old/date.c 2015-12-08 18:51:21.000000000 +0100
+++ new/date.c 2016-02-26 12:33:54.000000000 +0100
@@ -42,10 +42,12 @@
#define SECSPERMIN 60
#endif /* !defined SECSPERMIN */
+#if !HAVE_POSIX_DECLS
extern char ** environ;
extern char * optarg;
extern int optind;
-extern char * tzname[2];
+extern char * tzname[];
+#endif
static int retval = EXIT_SUCCESS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/localtime.c new/localtime.c
--- old/localtime.c 2015-10-01 10:43:59.000000000 +0200
+++ new/localtime.c 2016-02-26 17:58:45.000000000 +0100
@@ -178,11 +178,6 @@
static char lcl_TZname[TZ_STRLEN_MAX + 1];
static int lcl_is_set;
-char * tzname[2] = {
- (char *) wildabbr,
- (char *) wildabbr
-};
-
/*
** Section 4.12.3 of X3.159-1989 requires that
** Except for the strftime function, these functions [asctime,
@@ -193,10 +188,16 @@
static struct tm tm;
-#ifdef USG_COMPAT
+#if !HAVE_POSIX_DECLS
+char * tzname[2] = {
+ (char *) wildabbr,
+ (char *) wildabbr
+};
+# ifdef USG_COMPAT
long timezone;
int daylight;
-#endif /* defined USG_COMPAT */
+# endif
+#endif
#ifdef ALTZONE
long altzone;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/private.h new/private.h
--- old/private.h 2015-09-15 08:36:31.000000000 +0200
+++ new/private.h 2016-02-26 21:36:17.000000000 +0100
@@ -22,6 +22,10 @@
** You can override these in your C compiler options, e.g. '-DHAVE_GETTEXT=1'.
*/
+#ifndef HAVE_DECL_ASCTIME_R
+#define HAVE_DECL_ASCTIME_R 1
+#endif
+
#ifndef HAVE_GETTEXT
#define HAVE_GETTEXT 0
#endif /* !defined HAVE_GETTEXT */
@@ -34,6 +38,10 @@
#define HAVE_LINK 1
#endif /* !defined HAVE_LINK */
+#ifndef HAVE_POSIX_DECLS
+#define HAVE_POSIX_DECLS 1
+#endif
+
#ifndef HAVE_STRDUP
#define HAVE_STRDUP 1
#endif
@@ -106,6 +114,9 @@
#ifndef ENAMETOOLONG
# define ENAMETOOLONG EINVAL
#endif
+#ifndef ENOTSUP
+# define ENOTSUP EINVAL
+#endif
#ifndef EOVERFLOW
# define EOVERFLOW EINVAL
#endif
@@ -379,25 +390,21 @@
void tzset(void);
#endif
-/*
-** Some time.h implementations don't declare asctime_r.
-** Others might define it as a macro.
-** Fix the former without affecting the latter.
-** Similarly for timezone, daylight, and altzone.
-*/
-
-#ifndef asctime_r
-extern char * asctime_r(struct tm const *restrict, char *restrict);
+#if !HAVE_DECL_ASCTIME_R && !defined asctime_r
+extern char *asctime_r(struct tm const *restrict, char *restrict);
#endif
-#ifdef USG_COMPAT
-# ifndef timezone
+#if !HAVE_POSIX_DECLS
+# ifdef USG_COMPAT
+# ifndef timezone
extern long timezone;
-# endif
-# ifndef daylight
+# endif
+# ifndef daylight
extern int daylight;
+# endif
# endif
#endif
+
#if defined ALTZONE && !defined altzone
extern long altzone;
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strftime.c new/strftime.c
--- old/strftime.c 2015-12-08 18:51:21.000000000 +0100
+++ new/strftime.c 2016-02-26 12:33:54.000000000 +0100
@@ -106,7 +106,9 @@
int *);
static char * _yconv(int, int, bool, bool, char *, char const *);
+#if !HAVE_POSIX_DECLS
extern char * tzname[];
+#endif
#ifndef YEAR_2000_NAME
#define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tz-art.htm new/tz-art.htm
--- old/tz-art.htm 2016-01-18 07:53:52.000000000 +0100
+++ new/tz-art.htm 2016-03-15 01:49:25.000000000 +0100
@@ -353,10 +353,20 @@
isn't coming fast enough, so he sets his watch ahead an hour.
</li>
<li>
-The syndicated comic strip <em>Dilbert</em> featured an all-too-rare example of
-time zone humor on 1998-03-14.
+The syndicated comic strip <em>Dilbert</em> featured an
+<a href='http://dilbert.com/strip/1998-03-14'>all-too-rare example of
+time zone humor</a> on 1998-03-14.
</li>
<li>
+The webcomic <em>xkcd</em> has the strip
+"<a href='http://xkcd.com/673/'>The Sun</a>" (2009-12-09) and the panels
+"<a href='http://xkcd.com/1017/'>Backward in Time</a>" (2012-02-14),
+"<a href='http://xkcd.com/1061/'>EST</a>" (2012-05-28), and
+"<a href='http://xkcd.com/1335/'>Now</a>" (2014-02-26), and
+"<a href='http://xkcd.com/1655/'>Doomsday Clock</a>" (2016-03-14).
+The related book <em>What If?</em> has an entry
+"<a href='http://what-if.xkcd.com/26/'>Leap Seconds</a>" (2012-12-31).
+<li>
Surrealist artist Guy Billout's work "Date Line" appeared on page 103
of the 1999-11 <em>Atlantic Monthly</em>.
</li>
@@ -441,6 +451,14 @@
(Never mind that this should be 7:30am in Mumbai, yet for some reason the show
proceeds as though it's also mid-evening there.)
</li>
+<li>
+In the "14 Days to Go"/"T Minus..." episode of
+<em>You, Me and the Apocalypse</em>
+(first aired 2015-11-11 in the UK, 2016-03-10 in the US),
+the success of a mission to deal with a comet
+hinges on whether or not Russia observes daylight saving time.
+(In the US, the episode first aired in the week before the switch to DST.)
+</li>
</ul>
<hr>
<ul>
@@ -515,7 +533,7 @@
Marcie: "I promise there'll be a tomorrow, sir ... in fact,
it's already tomorrow in Australia!"
<br>
-(Charles M. Schulz, <em>Peanuts</em>, 1980-06-13)
+(Charles M. Schulz, <a href='http://www.gocomics.com/peanuts/1980/06/13'><em>Peanuts</em>, 1980-06-13</a>)
</li>
</ul>
</body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tz-how-to.html new/tz-how-to.html
--- old/tz-how-to.html 1970-01-01 01:00:00.000000000 +0100
+++ new/tz-how-to.html 2016-03-01 06:00:44.000000000 +0100
@@ -0,0 +1,676 @@
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head><title>How to Read the tz Database</title></head>
+<body>
+<h2>How to Read the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
+Database</a> Source Files</h2>
+<h3>by Bill Seymour</h3>
+<p>This page uses the <code>America/Chicago</code> and
+<code>Pacific/Honolulu</code> zones as examples of how to infer
+times of day from the <a href="tz-link.htm">tz database</a>
+source files. It might be helpful, but not absolutely necessary,
+for the reader to have already downloaded the
+<a href="http://www.iana.org/time-zones/repository/tzdata-latest.tar.gz">latest
+release of the database</a> and become familiar with the basic layout
+of the data files. The format is explained in the “man
+page” for the zic compiler, <code>zic.8.txt</code>, in
+the <code>code</code> subdirectory.</p>
+
+<p>We’ll begin by talking about the rules for changing between standard
+and daylight saving time since we’ll need that information when we talk
+about the zones.</p>
+
+<p>First, let’s consider the special daylight saving time rules
+for Chicago (from the <code>northamerica</code> file in
+the <code>data</code> subdirectory):</p>
+
+<table border="1">
+<tr>
+ <th colspan="6">From the Source File</th>
+</tr>
+<tr>
+ <td colspan="6" align="center"><table><tr><td>
+<pre>
+#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER
+Rule Chicago 1920 only - Jun 13 2:00 1:00 D
+Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S
+Rule Chicago 1921 only - Mar lastSun 2:00 1:00 D
+Rule Chicago 1922 1966 - Apr lastSun 2:00 1:00 D
+Rule Chicago 1922 1954 - Sep lastSun 2:00 0 S
+Rule Chicago 1955 1966 - Oct lastSun 2:00 0 S
+</pre>
+ </td></tr></table></td>
+</tr>
+<tr>
+ <th colspan="6">Reformatted a Bit</th>
+</tr>
+<tr>
+ <th>From</th>
+ <th>To</th>
+ <th colspan="2">On</th>
+ <th>At</th>
+ <th>Action</th>
+</tr>
+<tr align="center">
+ <td colspan="2">1920 only</td>
+ <td colspan="2">June 13<small><sup>th</sup></small></td>
+ <td rowspan="6">02:00 local</td>
+ <td>go to daylight saving time</td>
+</tr>
+<tr align="center">
+ <td>1920</td>
+ <td>1921</td>
+ <td rowspan="5">last Sunday</td>
+ <td>in October</td>
+ <td>return to standard time</td>
+</tr>
+<tr align="center">
+ <td colspan="2">1921 only</td>
+ <td>in March</td>
+ <td rowspan="2">go to daylight saving time</td>
+</tr>
+<tr align="center">
+ <td rowspan="2">1922</td>
+ <td>1966</td>
+ <td>in April</td>
+</tr>
+<tr align="center">
+ <td>1954</td>
+ <td>in September</td>
+ <td rowspan="2">return to standard time</td>
+</tr>
+<tr align="center">
+ <td>1955</td>
+ <td>1966</td>
+ <td>in October</td>
+</tr>
+</table>
+
+<p>We’ll basically just ignore the <code>TYPE</code> column.
+In the 2007j release, the most recent as of this writing, the
+<code>TYPE</code> column never contains anything but a hyphen,
+a kind of null value. (From the description in <code>zic.8.txt</code>,
+this appears to be a mechanism for removing years from a set
+in some localizable way. It’s used in the file, <code>pacificnew</code>,
+to determine whether a given year will have a US presidential election;
+but everything related to that use is commented out.)
+
+<p>The <code>SAVE</code> column contains the wall clock offset from
+local standard time.
+This is usually either zero for standard time or one hour for daylight
+saving time; but there’s no reason, in principle, why it can’t
+take on other values.
+
+<p>The <code>LETTER</code> (sometimes called <code>LETTER/S</code>)
+column can contain a variable
+part of the usual abbreviation of the time zone’s name, or it can just
+be a hyphen if there’s no variable part. For example, the abbreviation
+used in the central time zone will be either “CST” or
+“CDT”. The variable part is ‘S’ or ‘D’;
+and, sure enough, that’s just what we find in
+the <code>LETTER</code> column
+in the <code>Chicago</code> rules. More about this when we talk about
+“Zone” lines.
+
+<p>One important thing to notice is that “Rule” lines
+want at once to be both <i>transitions</i> and <i>steady states</i>:
+<ul>
+<li>On the one hand, they represent transitions between standard and
+daylight saving time; and any number of Rule lines can be in effect
+during a given period (which will always be a non-empty set of
+contiguous calendar years).</li>
+<li>On the other hand, the <code>SAVE</code> and <code>LETTER</code>
+columns contain state that exists between transitions. More about this
+when we talk about the US rules.</li>
+</ul>
+
+<p>In the example above, the transition to daylight saving time
+happened on the 13<small><sup>th</sup></small> of June in 1920, and on
+the last Sunday in March in 1921; but the return to standard time
+happened on the last Sunday in October in both of those
+years. Similarly, the rule for changing to daylight saving time was
+the same from 1922 to 1966; but the rule for returning to standard
+time changed in 1955. Got it?</p>
+
+<p>OK, now for the somewhat more interesting “US” rules:</p>
+
+<table border="1">
+<tr>
+ <th colspan="6">From the Source File</th>
+</tr>
+<tr>
+ <td colspan="6" align="center"><table><tr><td>
+<pre>
+#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule US 1918 1919 - Mar lastSun 2:00 1:00 D
+Rule US 1918 1919 - Oct lastSun 2:00 0 S
+Rule US 1942 only - Feb 9 2:00 1:00 W # War
+Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace
+Rule US 1945 only - Sep 30 2:00 0 S
+Rule US 1967 2006 - Oct lastSun 2:00 0 S
+Rule US 1967 1973 - Apr lastSun 2:00 1:00 D
+Rule US 1974 only - Jan 6 2:00 1:00 D
+Rule US 1975 only - Feb 23 2:00 1:00 D
+Rule US 1976 1986 - Apr lastSun 2:00 1:00 D
+Rule US 1987 2006 - Apr Sun>=1 2:00 1:00 D
+Rule US 2007 max - Mar Sun>=8 2:00 1:00 D
+Rule US 2007 max - Nov Sun>=1 2:00 0 S
+</pre>
+ </td></tr></table></td>
+</tr>
+<tr>
+ <th colspan="6">Reformatted a Bit</th>
+</tr>
+<tr>
+ <th>From</th>
+ <th>To</th>
+ <th colspan="2">On</th>
+ <th>At</th>
+ <th>Action</th>
+</tr>
+<tr align="center">
+ <td rowspan="2">1918</td>
+ <td rowspan="2">1919</td>
+ <td rowspan="2">last Sunday</td>
+ <td>in March</td>
+ <td rowspan="3">02:00 local</td>
+ <td>go to daylight saving time</td>
+</tr>
+<tr align="center">
+ <td>in October</td>
+ <td>return to standard time</td>
+</tr>
+<tr align="center">
+ <td colspan="2">1942 only</td>
+ <td colspan="2">February 9<small><sup>th</sup></small></td>
+ <td>go to “war time”</td>
+</tr>
+<tr align="center">
+ <td colspan="2" rowspan="2">1945 only</td>
+ <td colspan="2">August 14<small><sup>th</sup></small></td>
+ <td>23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a></td>
+ <td>
+ rename “war time” to “peace<br>time;”
+ clocks don’t change
+ </td>
+</tr>
+<tr align="center">
+ <td colspan="2">September 30<small><sup>th</sup></small></td>
+ <td rowspan="9">02:00 local</td>
+ <td rowspan="2">return to standard time</td>
+</tr>
+<tr align="center">
+ <td rowspan="2">1967</td>
+ <td>2006</td>
+ <td rowspan="2">last Sunday</td>
+ <td>in October</td>
+</tr>
+<tr align="center">
+ <td>1973</td>
+ <td>in April</td>
+ <td rowspan="6">go to daylight saving time</td>
+</tr>
+<tr align="center">
+ <td colspan="2">1974 only</td>
+ <td colspan="2">January 6<small><sup>th</sup></small></td>
+</tr>
+<tr align="center">
+ <td colspan="2">1975 only</td>
+ <td colspan="2">February 23<small><sup>rd</sup></small></td>
+</tr>
+<tr align="center">
+ <td>1976</td>
+ <td>1986</td>
+ <td>last Sunday</td>
+ <td rowspan="2">in April</td>
+</tr>
+<tr align="center">
+ <td>1987</td>
+ <td>2006</td>
+ <td>first Sunday</td>
+</tr>
+<tr align="center">
+ <td rowspan="2">2007</td>
+ <td rowspan="2">present</td>
+ <td colspan="2">second Sunday in March</td>
+</tr>
+<tr align="center">
+ <td colspan="2">first Sunday in November</td>
+ <td>return to standard time</td>
+</tr>
+</table>
+
+<p>There are two interesting things to note here.</p>
+
+<p>First, the time that something happens (in the <code>AT</code>
+column) is not necessarily the local wall clock time. The time can be
+suffixed with ‘s’ (for “standard”) to mean
+local standard time (different from wall clock time when observing
+daylight saving time); or it can be suffixed with ‘g’,
+‘u’, or ‘z’, all three of which mean the
+standard time at the
+<a href="https://en.wikipedia.org/wiki/Prime_Meridian">prime meridan</a>.
+‘g’ stands for “https://en.wikipedia.org/wiki/Greenwich_Mean_Time">GMT</a>”;
+‘u’ stands for “https://en.wikipedia.org/wiki/Universal_Time">UT</a>” or “https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>”
+(whichever was official at the time); ‘z’ stands for the
+<a href="https://en.wikipedia.org/wiki/Nautical_time">nautical time zone</a>
+Z (a.k.a. “Zulu” which, in turn, stands for ‘Z’).
+The time can also be suffixed with ‘w’ meaning “wall
+clock time;” but it usually isn’t because that’s the
+default.</p>
+
+<p>Second, the day in the <code>ON</code> column, in addition to
+“<code>lastSun</code>” or a particular day of the month,
+can have the form, “<code>Sun>=</code><i>x</i>” or
+“<code>Sun<=</code><i>x</i>,” where <i>x</i> is a day
+of the month. For example, “<code>Sun>=8</code>” means
+“the first Sunday on or after the eighth of the month,” in
+other words, the second Sunday of the month. Furthermore, although
+there are no examples above, the weekday needn’t be
+“<code>Sun</code>” in either form, but can be the usual
+three-character English abbreviation for any day of the week.</p>
+
+<p>And the US rules give us more examples of a couple of things
+already mentioned:</p>
+
+<ul>
+<li>The rules for changing to and from daylight saving time are
+actually <i>different sets</i> of rules; and the two sets can change
+independently. Consider, for example, that the rule for the return to
+standard time stayed the same from 1967 to 2006; but the rule for the
+transition to daylight saving time changed several times in the same
+period. There can also be periods, 1946 to 1966 for example, when no
+rule from this group is in effect, and so either no transition
+happened in those years, or some other rule is in effect (perhaps a
+state or other more local rule).</li>
+
+<li>The <code>SAVE</code> and <code>LETTER</code> columns
+contain <i>steady state</i>, not transitions. Consider, for example,
+the transition from “war time” to “peace time”
+that happened on August 14, 1945. The “1:00” in
+the <code>SAVE</code> column is <i>not</i> an instruction to advance
+the clock an hour. It means that clocks should <i>be</i> one hour
+ahead of standard time, which they already are because of the previous
+rule, so there should be no change.</li>
+
+</ul>
+
+<p>OK, now let’s look at a Zone record:</p>
+
+<table border="1">
+<tr>
+ <th colspan="5">From the Source File</th>
+</tr>
+<tr>
+ <td colspan="6" align="center"><table><tr><td>
+<pre>
+#Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone America/Chicago -5:50:36 - LMT 1883 Nov 18 12:09:24
+ -6:00 US C%sT 1920
+ -6:00 Chicago C%sT 1936 Mar 1 2:00
+ -5:00 - EST 1936 Nov 15 2:00
+ -6:00 Chicago C%sT 1942
+ -6:00 US C%sT 1946
+ -6:00 Chicago C%sT 1967
+ -6:00 US C%sT
+</pre>
+ </td></tr></table></td>
+</tr>
+<tr>
+ <th colspan="5">Columns Renamed</th>
+</tr>
+<tr>
+ <th rowspan="2">Standard Offset<br>
+ from <a href="https://en.wikipedia.org/wiki/Prime_Meridian">Prime
+ Meridian</a></th>
+ <th rowspan="2">Daylight<br>Saving Time</th>
+ <th rowspan="2">Abbreviation(s)</th>
+ <th colspan="2">Ending at Local Time</th>
+</tr>
+<tr>
+ <th>Date</th>
+ <th>Time</th>
+</tr>
+<tr align="center">
+ <td>−5:50:36</td>
+ <td>not observed</td>
+ <td>LMT</td>
+ <td>1883-11-18</td>
+ <td>12:09:24</td>
+</tr>
+<tr align="center">
+ <td rowspan="2">−6:00:00</td>
+ <td>US rules</td>
+ <td rowspan="2">CST or CDT</td>
+ <td>1920-01-01</td>
+ <td>00:00:00</td>
+</tr>
+<tr align="center">
+ <td>Chicago rules</td>
+ <td>1936-03-01</td>
+ <td rowspan="2">02:00:00</td>
+</tr>
+<tr align="center">
+ <td>−5:00:00</td>
+ <td>not observed</td>
+ <td>EST</td>
+ <td>1936-11-15</td>
+</tr>
+<tr align="center">
+ <td rowspan="4">−6:00:00</td>
+ <td>Chicago rules</td>
+ <td>CST or CDT</td>
+ <td>1942-01-01</td>
+ <td rowspan="3">00:00:00</td>
+</tr>
+<tr align="center">
+ <td>US rules</td>
+ <td>CST, CWT or CPT</td>
+ <td>1946-01-01</td>
+</tr>
+<tr align="center">
+ <td>Chicago rules</td>
+ <td rowspan="2">CST or CDT</td>
+ <td>1967-01-01</td>
+</tr>
+<tr align="center">
+ <td>US rules</td>
+ <td colspan="2">—</td>
+</tr>
+</table>
+
+<p>There are a couple of interesting differences between Zones and Rules.</p>
+
+<p>First, and somewhat trivially, whereas Rules are considered to
+contain one or more records, a Zone is considered to be a single
+record with zero or more <i>continuation lines</i>. Thus, the keyword,
+“<code>Zone</code>,” and the zone name are not
+repeated. The last line is the one without anything in
+the <code>[UNTIL]</code> column.</p>
+
+<p>Second, and more fundamentally, each line of a Zone represents a
+steady state, not a transition between states. The state exists from
+the date and time in the previous line’s <code>[UNTIL]</code>
+column up to the date and time in the current
+line’s <code>[UNTIL]</code> column. In other words, the date and
+time in the <code>[UNTIL]</code> column is the instant that separates
+this state from the next. Where that would be ambiguous because
+we’re setting our clocks back, the <code>[UNTIL]</code> column
+specifies the first occurrence of the instant. The state specified by
+the last line, the one without anything in the <code>[UNTIL]</code>
+column, continues to the present.</p>
+
+<p>The first line typically specifies the mean solar time observed
+before the introduction of standard time. Since there’s no line before
+that, it has no beginning. <code>8-) </code> For some places near the https://en.wikipedia.org/wiki/International_Date_Line">International
+Date Line</a>, the first <i>two</i> lines will show solar times
+differing by 24 hours; this corresponds to a movement of the Date
+Line. For example:</p>
+
+<pre>
+#Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
+ -8:57:41 - LMT ...
+</pre>
+
+<p>When Alaska was purchased from Russia in 1867, the Date Line moved
+from the Alaska/Canada border to the Bering Strait; and the time in
+Alaska was then 24 hours earlier than it had
+been. <code><aside></code>(6 October in the Julian calendar,
+which Russia was still using then for religious reasons, was followed
+by <i>a second instance of the same day with a different name</i>, 18
+October in the Gregorian calendar. Isn’t civil time
+wonderful? <code>8-)</code>)<code></aside></code></p>
+
+<p>The abbreviation, “LMT” stands for “local mean
+time”, which is an invention of
+the <a href="https://en.wikipedia.org/wiki/Tz_database">tz
+database</a> and was probably never actually used during the
+period. Furthermore, the value is almost certainly wrong except in the
+archetypal place after which the zone is named. (The tz database
+usually doesn’t provide a separate Zone record for places where
+nothing significant happened after 1970.)</p>
+
+<p>The <code>RULES</code> column tells us whether daylight saving time is being observed:
+<ul>
+<li>A hyphen, a kind of null value, means that we have not set our
+clocks ahead of standard time.</li>
+
+<li>An amount of time (usually but not necessarily “1:00”
+meaning one hour) means that we have set our clocks ahead by that
+amount.</li>
+
+<li>Some alphabetic string means that we <i>might have</i> set our
+clocks ahead; and we need to check the rule the name of which is the
+given alphabetic string.</li>
+</ul>
+
+<p>An example of a specific amount of time is:</p>
+<pre>
+#Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone Pacific/Honolulu ... 1933 Apr 30 2:00
+ -10:30 1:00 HDT 1933 May 21 2:00
+ ...
+</pre>
+
+<p>Hawaii tried daylight saving time for three weeks in 1933 and
+decided they didn’t like it. <code>8-) </code>Note that
+the <code>GMTOFF</code> column always contains the standard time
+offset, so the wall clock time during this period was GMT −
+10:30 + 1:00 = GMT − 9:30.</p>
+
+<p>The <code>FORMAT</code> column specifies the usual abbreviation of
+the time zone name. It can have one of four forms:</p>
+<ul>
+
+<li>the string, “<code>zzz</code>,” which is a kind of
+null value (don’t ask)</li>
+
+<li>a single alphabetic string other than “<code>zzz</code>,”
+in which case that’s the abbreviation</li>
+
+<li>a pair of strings separated by a slash
+(‘<code>/</code>’), in which case the first string is the
+abbreviation for the standard time name and the second string is the
+abbreviation for the daylight saving time name</li>
+
+<li>a string containing “<code>%s</code>,” in which case
+the “<code>%s</code>” will be replaced by the text in the
+appropriate Rule’s <code>LETTER</code> column</li>
+</ul>
+
+<p>The last two make sense only if there’s a named rule in effect.</p>
+
+<p>An example of a slash is:</p>
+<pre>
+#Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone Europe/London ... 1996
+ 0:00 EU GMT/BST
+</pre>
+
+<p>The current time in the UK is called either Greenwich mean time or
+British summer time.</p>
+
+<p>One wrinkle, not fully explained in <code>zic.8.txt</code>, is what
+happens when switching to a named rule. To what values should
+the <code>SAVE</code> and <code>LETTER</code> data be initialized?</p>
+
+<ul>
+<li>If at least one transition has happened, use
+the <code>SAVE</code> and <code>LETTER</code> data from the most
+recent.</li>
+
+<li>If switching to a named rule before any transition has happened,
+assume standard time (<code>SAVE</code> zero), and use
+the <code>LETTER</code> data from the earliest transition with
+a <code>SAVE</code> of zero.
+
+</ul>
+
+<p>And two last things about the <code>FORMAT</code> column:</p>
+<ul>
+
+<li>The <a href="https://en.wikipedia.org/wiki/Tz_database">tz
+database</a> gives abbreviations for time zone names in <i>popular
+usage</i>, which is not necessarily “correct” by law. For
+example, the last line in
+<code>Zone</code> <code>Pacific/Honolulu</code> (shown below) gives
+“HST” for “Hawaii standard time” even though the
+<a href="http://www.law.cornell.edu/uscode/html/uscode15/usc_sec_15_00000263----000-.html">legal</a>
+name for that time zone is “Hawaii-Aleutian standard time.”
+This author has read that there are also some places in Australia where
+popular time zone names differ from the legal ones.
+
+<li>No attempt is made to https://en.wikipedia.org/wiki/Internationalization_and_localization">localize</a>
+the abbreviations. They are intended to be the values returned through the
+<code>"%Z"</code> format specifier to
+<a href="https://en.wikipedia.org/wiki/C_(programming_language)">C</a>’s
+<a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html"><code>strftime</code></a>
+function in the
+<a href="http://www.chemie.fu-berlin.de/chemnet/use/info/libc/libc_19.html#SEC324">“C” locale</a>.
+</ul>
+
+<p>As a final example, here’s the complete history for Hawaii:</p>
+
+<table border="1">
+<tr>
+ <th colspan="6">Relevant Excerpts from the US Rules</th>
+</tr>
+<tr>
+ <td colspan="6" align="center"><table><tr><td>
+<pre>
+#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
+Rule US 1918 1919 - Oct lastSun 2:00 0 S
+Rule US 1942 only - Feb 9 2:00 1:00 W # War
+Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace
+Rule US 1945 only - Sep 30 2:00 0 S
+</pre>
+ </td></tr></table></td>
+</tr>
+<tr>
+ <th colspan="6">The Zone Record</th>
+</tr>
+<tr>
+ <td colspan="6" align="center"><table><tr><td>
+<pre>
+#Zone NAME GMTOFF RULES FORMAT [UNTIL]
+Zone Pacific/Honolulu -10:31:26 - LMT 1900 Jan 1 12:00
+ -10:30 - HST 1933 Apr 30 2:00
+ -10:30 1:00 HDT 1933 May 21 2:00
+ -10:30 US H%sT 1947 Jun 8 2:00
+ -10:00 - HST
+</pre>
+ </td></tr></table></td>
+</tr>
+<tr>
+ <th colspan="6">What We Infer</th>
+</tr>
+<tr>
+ <th rowspan="2">Wall-Clock<br>Offset from<br>Prime Meridian</th>
+ <th rowspan="2">Adjust<br>Clocks</th>
+ <th colspan="2">Time Zone</th>
+ <th colspan="2">Ending at Local Time</th>
+</tr>
+<tr>
+ <th>Abbrv.</th>
+ <th>Name</th>
+ <th>Date</th>
+ <th>Time</th>
+</tr>
+<tr align="center">
+ <td>−10:31:26</td>
+ <td>—</td>
+ <td>LMT</td>
+ <td>local mean time</td>
+ <td>1900-01-01</td>
+ <td>12:00</td>
+</tr>
+<tr align="center">
+ <td>−10:30</td>
+ <td>+0:01:26</td>
+ <td>HST</td>
+ <td>Hawaii standard time</td>
+ <td>1933-04-30</td>
+ <td rowspan="3">02:00</td>
+</tr>
+<tr align="center">
+ <td>−9:30</td>
+ <td>+1:00</td>
+ <td>HDT</td>
+ <td>Hawaii daylight time</td>
+ <td>1933-05-21</td>
+</tr>
+<tr align="center">
+ <td>−10:30¹</td>
+ <td>−1:00¹</td>
+ <td>HST¹</td>
+ <td>Hawaii standard time</td>
+ <td>1942-02-09</td>
+</tr>
+<tr align="center">
+ <td rowspan="2">−9:30</td>
+ <td>+1:00</td>
+ <td>HWT</td>
+ <td>Hawaii war time</td>
+ <td>1945-08-14</td>
+ <td>13:30²</td>
+</tr>
+<tr align="center">
+ <td>0</td>
+ <td>HPT</td>
+ <td>Hawaii peace time</td>
+ <td>1945-09-30</td>
+ <td rowspan="2">02:00</td>
+</tr>
+<tr align="center">
+ <td>−10:30</td>
+ <td>−1:00</td>
+ <td rowspan="2">HST</td>
+ <td rowspan="2">Hawaii standard time</td>
+ <td>1947-06-08</td>
+</tr>
+<tr align="center">
+ <td>−10:00³</td>
+ <td>+0:30³</td>
+ <td colspan="2">—</td>
+</tr>
+<tr>
+ <td colspan="6">
+ ¹Switching to US rules…most recent transition (in 1919) was to standard time
+ </td>
+</tr>
+<tr>
+ <td colspan="6">
+ ²23:00 <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>
+ + (−9:30) = 13:30 local
+ </td>
+</tr>
+<tr>
+ <td colspan="6">
+ ³Since <a href="https://en.wikipedia.org/wiki/ISO_8601">1947–06–08T12:30Z</a>,
+ the civil time in Hawaii has been
+ <a href="https://en.wikipedia.org/wiki/Universal_Time">UT</a>/<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">UTC</a>
+ − 10:00 year-round.
+ </td>
+</tr>
+</table>
+
+<p>There will be a short quiz later. <code>8-)</code></p>
+
+<hr>
+<address>
+This web page is in the public domain, so clarified as of
+2015-10-20 by Bill Seymour.
+<br>
+All suggestions and corrections will be welcome; all flames will be amusing.
+Mail to was at pobox dot com.
+</address>
+</body>
+</html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tz-link.htm new/tz-link.htm
--- old/tz-link.htm 2015-12-13 09:46:33.000000000 +0100
+++ new/tz-link.htm 2016-03-01 06:00:44.000000000 +0100
@@ -10,7 +10,7 @@
content="Sources for time zone and daylight saving time data">
<meta name="DC.Creator" content="Eggert, Paul">
<meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2015-12-13">
+<meta name="DC.Date" content="2016-02-29">
<meta name="DC.Description"
content="Sources of information about time zones and daylight saving time">
http://twiki.org/cgi-bin/xtra/tzdatepick.html">Date and Time Gateway</a>
lets you see the <code><abbr>TZ</abbr></code> values directly.</li>
<li>http://convertit.com/Go/ConvertIt/World_Time/Current_Time.ASP">Current
+href="http://www.convertit.com/Go/ConvertIt/World_Time/Current_Time.ASP">Current
Time in 1000 Places</a> uses descriptions of the values.</li>
<li><a href="http://www.timezoneconverter.com/cgi-bin/tzc.tzc">Time Zone
Converter</a>
@@ -209,7 +209,7 @@
<li><a href="http://home.kpn.nl/vanadovv/time/TZworld.html">Complete
timezone information for all countries</a> displays tables of DST rules.
<li><a href="http://www.timeanddate.com/worldclock/">The World Clock –
-Time Zones</a> lets you sort zone names and convert times.</li>
+Worldwide</a> lets you sort zone names and convert times.</li>
<li><a href="http://www.zeitverschiebung.net/en/">Time Difference</a>
calculates the current time difference between locations.</li>
<li><a href="http://www.wx-now.com">Weather Now</a> lists the weather too.</li>
@@ -642,7 +642,7 @@
history of legal time in Singapore and Malaysia.</dd>
<dt>United Kingdom</dt>
<dd>http://www.polyomino.org.uk/british-time/">History of
+href="https://www.polyomino.org.uk/british-time/">History of
legal time in Britain</a> discusses in detail the country
with perhaps the best-documented history of clock adjustments.
The National Physical Laboratory also maintains an http://www.transportation.gov/regulations/recent-time-zone-proceedings">Recent
+href="https://www.transportation.gov/regulations/recent-time-zone-proceedings">Recent
Time Zone Proceedings</a> lists changes to time zone boundaries.</dd>
</dl>
<h2>Precision timekeeping</h2>
@@ -699,7 +699,7 @@
<abbr title="International Atomic Time">TAI</abbr>,
<abbr>TDB</abbr>, <abbr>TDT</abbr> and
<abbr>UTC</abbr>.</li>
-<li><a href="http://www2.jpl.nasa.gov/basics/bsf2-3.php">Basics of
+<li><a href="http://solarsystem.nasa.gov/basics/bsf2-3.php">Basics of
Space Flight – Reference Systems – Time Conventions</a>
briefly explains interplanetary space flight timekeeping.</li>
<li>&2 "
+test -t 1 && say >&2 "
You can make this change permanent for yourself by appending the line
$line
to the file '$file' in your home directory; then log out and log in again.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zdump.c new/zdump.c
--- old/zdump.c 2015-07-29 03:34:13.000000000 +0200
+++ new/zdump.c 2016-02-26 12:33:54.000000000 +0100
@@ -238,12 +238,14 @@
# define timezone_t char **
#endif
+#if !HAVE_POSIX_DECLS
extern char ** environ;
extern int getopt(int argc, char * const argv[],
const char * options);
extern char * optarg;
extern int optind;
-extern char * tzname[2];
+extern char * tzname[];
+#endif
/* The minimum and maximum finite time values. */
enum { atime_shift = CHAR_BIT * sizeof (time_t) - 2 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zic.c new/zic.c
--- old/zic.c 2015-08-12 02:40:25.000000000 +0200
+++ new/zic.c 2016-02-26 12:33:54.000000000 +0100
@@ -22,6 +22,13 @@
#define ZIC_MAX_ABBR_LEN_WO_WARN 6
#endif /* !defined ZIC_MAX_ABBR_LEN_WO_WARN */
+#ifdef HAVE_DIRECT_H
+# include
+# include
+# undef mkdir
+# define mkdir(name, mode) _mkdir(name)
+#endif
+
#if HAVE_SYS_STAT_H
#include
#endif
@@ -87,17 +94,19 @@
zic_t z_untiltime;
};
+#if !HAVE_POSIX_DECLS
extern int getopt(int argc, char * const argv[],
const char * options);
extern int link(const char * fromname, const char * toname);
extern char * optarg;
extern int optind;
+#endif
#if ! HAVE_LINK
-# define link(from, to) (-1)
+# define link(from, to) (errno = ENOTSUP, -1)
#endif
#if ! HAVE_SYMLINK
-# define symlink(from, to) (-1)
+# define symlink(from, to) (errno = ENOTSUP, -1)
#endif
static void addtt(zic_t starttime, int type);
@@ -758,41 +767,47 @@
progname, fromname, e);
exit(EXIT_FAILURE);
}
- if (itsdir(toname) <= 0)
- remove(toname);
if (link(fromname, toname) != 0) {
- int result;
+ int link_errno = errno;
+ bool retry_if_link_supported = false;
- if (! mkdirs(toname))
- exit(EXIT_FAILURE);
-
- result = link(fromname, toname);
- if (result != 0) {
- const char *s = fromfield;
- const char *t;
- char *p;
- size_t dotdots = 0;
- register char * symlinkcontents = NULL;
-
- do
- t = s;
- while ((s = strchr(s, '/'))
- && ! strncmp (fromfield, tofield,
- ++s - fromfield));
-
- for (s = tofield + (t - fromfield); *s; s++)
- dotdots += *s == '/';
- symlinkcontents
- = emalloc(3 * dotdots + strlen(t) + 1);
- for (p = symlinkcontents; dotdots-- != 0; p += 3)
- memcpy(p, "../", 3);
- strcpy(p, t);
- result = symlink(symlinkcontents, toname);
- if (result == 0)
-warning(_("hard link failed, symbolic link used"));
- free(symlinkcontents);
- }
- if (result != 0) {
+ if (link_errno == ENOENT || link_errno == ENOTSUP) {
+ if (! mkdirs(toname))
+ exit(EXIT_FAILURE);
+ retry_if_link_supported = true;
+ }
+ if ((link_errno == EEXIST || link_errno == ENOTSUP)
+ && itsdir(toname) == 0
+ && (remove(toname) == 0 || errno == ENOENT))
+ retry_if_link_supported = true;
+ if (retry_if_link_supported && link_errno != ENOTSUP)
+ link_errno = link(fromname, toname) == 0 ? 0 : errno;
+ if (link_errno != 0) {
+ const char *s = fromfield;
+ const char *t;
+ char *p;
+ size_t dotdots = 0;
+ char *symlinkcontents;
+ int symlink_result;
+
+ do
+ t = s;
+ while ((s = strchr(s, '/'))
+ && strncmp(fromfield, tofield, ++s - fromfield) == 0);
+
+ for (s = tofield + (t - fromfield); *s; s++)
+ dotdots += *s == '/';
+ symlinkcontents = emalloc(3 * dotdots + strlen(t) + 1);
+ for (p = symlinkcontents; dotdots-- != 0; p += 3)
+ memcpy(p, "../", 3);
+ strcpy(p, t);
+ symlink_result = symlink(symlinkcontents, toname);
+ free(symlinkcontents);
+ if (symlink_result == 0) {
+ if (link_errno != ENOTSUP)
+ warning(_("symbolic link used because hard link failed: %s"),
+ strerror (link_errno));
+ } else {
FILE *fp, *tp;
int c;
fp = fopen(fromname, "rb");
@@ -815,8 +830,11 @@
putc(c, tp);
close_file(fp, fromname);
close_file(tp, toname);
- warning(_("link failed, copy used"));
- }
+ if (link_errno != ENOTSUP)
+ warning(_("copy used because hard link failed: %s"),
+ strerror (link_errno));
+ }
+ }
}
free(fromname);
free(toname);
@@ -863,18 +881,17 @@
{
struct stat st;
int res = stat(name, &st);
- if (res != 0)
- return res;
#ifdef S_ISDIR
- return S_ISDIR(st.st_mode) != 0;
-#else
- {
+ if (res == 0)
+ return S_ISDIR(st.st_mode) != 0;
+#endif
+ if (res == 0 || errno == EOVERFLOW) {
char *nameslashdot = relname(name, ".");
- res = stat(nameslashdot, &st);
+ bool dir = stat(nameslashdot, &st) == 0 || errno == EOVERFLOW;
free(nameslashdot);
- return res == 0;
+ return dir;
}
-#endif
+ return -1;
}
/*
@@ -1685,7 +1702,7 @@
/*
** Remove old file, if any, to snap links.
*/
- if (itsdir(fullname) <= 0 && remove(fullname) != 0 && errno != ENOENT) {
+ if (itsdir(fullname) == 0 && remove(fullname) != 0 && errno != ENOENT) {
const char *e = strerror(errno);
fprintf(stderr, _("%s: Can't remove %s: %s\n"),
++++++ tzdata-china.diff ++++++
--- /var/tmp/diff_new_pack.kcBciG/_old 2016-03-26 15:07:52.000000000 +0100
+++ /var/tmp/diff_new_pack.kcBciG/_new 2016-03-26 15:07:52.000000000 +0100
@@ -1,8 +1,8 @@
-Index: timezone-2015d/asia
+Index: timezone-2016b/asia
===================================================================
---- timezone-2015d.orig/asia
-+++ timezone-2015d/asia
-@@ -516,6 +516,10 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:
+--- timezone-2016b.orig/asia
++++ timezone-2016b/asia
+@@ -518,6 +518,10 @@ Rule PRC 1987 1991 - Apr Sun>=10 0:00 1:
Zone Asia/Shanghai 8:05:43 - LMT 1901
8:00 Shang C%sT 1949
8:00 PRC C%sT
@@ -13,11 +13,11 @@
# Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
# / Wulumuqi. (Please use Asia/Shanghai if you prefer Beijing time.)
Zone Asia/Urumqi 5:50:20 - LMT 1928
-Index: timezone-2015d/backward
+Index: timezone-2016b/backward
===================================================================
---- timezone-2015d.orig/backward
-+++ timezone-2015d/backward
-@@ -93,7 +93,7 @@ Link America/Mexico_City Mexico/General
+--- timezone-2016b.orig/backward
++++ timezone-2016b/backward
+@@ -94,7 +94,7 @@ Link America/Mexico_City Mexico/General
Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo
@@ -26,12 +26,12 @@
Link Pacific/Pohnpei Pacific/Ponape
Link Pacific/Pago_Pago Pacific/Samoa
Link Pacific/Chuuk Pacific/Truk
-Index: timezone-2015d/zone.tab
+Index: timezone-2016b/zone.tab
===================================================================
---- timezone-2015d.orig/zone.tab
-+++ timezone-2015d/zone.tab
-@@ -143,6 +143,7 @@ CK -2114-15946 Pacific/Rarotonga
- CL -3327-07040 America/Santiago most locations
+--- timezone-2016b.orig/zone.tab
++++ timezone-2016b/zone.tab
+@@ -144,6 +144,7 @@ CK -2114-15946 Pacific/Rarotonga
+ CL -3327-07040 America/Santiago Chile (most areas)
CL -2709-10926 Pacific/Easter Easter Island
CM +0403+00942 Africa/Douala
+CN +3955+11626 Asia/Beijing China Standard Time
++++++ tzdata2016a.tar.gz -> tzdata2016c.tar.gz ++++++
++++ 1872 lines of diff (skipped)