SHA256
3
0
forked from pool/timezone

timezone update 2016g

OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=186
This commit is contained in:
Andreas Stieger 2016-09-16 12:22:30 +00:00 committed by Git OBS Bridge
parent 8242cd8f68
commit 96cba8175e
20 changed files with 68 additions and 896 deletions

View File

@ -1,66 +0,0 @@
From 6d5fc7fed0690f22574a9b795575e2bb7962716c Mon Sep 17 00:00:00 2001
From: Tim Parenti <tim@timtimeonline.com>
Date: Mon, 18 Jul 2016 23:10:36 -0400
Subject: [PATCH] Positive leap second on 2016-12-31
* leap-seconds.list: Per IERS Bulletin C52 (2016-07-06), a
positive leap second will be inserted into the UTC time scale at the end
of 2016-12-31. Update file from NIST, retrieved from
<ftp://time.nist.gov/pub/leap-seconds.list>.
---
leap-seconds.list | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/leap-seconds.list b/leap-seconds.list
index 7552796..22fa785 100644
--- a/leap-seconds.list
+++ b/leap-seconds.list
@@ -143,7 +143,7 @@
# Boulder, Colorado
# Judah.Levine@nist.gov
#
-# Last Update of leap second values: 5 January 2015
+# Last Update of leap second values: 8 July 2016
#
# The following line shows this last update date in NTP timestamp
# format. This is the date on which the most recent change to
@@ -151,7 +151,7 @@
# be identified by the unique pair of characters in the first two
# columns as shown below.
#
-#$ 3629404800
+#$ 3676924800
#
# The NTP timestamps are in units of seconds since the NTP epoch,
# which is 1 January 1900, 00:00:00. The Modified Julian Day number
@@ -199,10 +199,10 @@
# current -- the update time stamp, the data and the name of the file
# will not change.
#
-# Updated through IERS Bulletin C51
-# File expires on: 28 December 2016
+# Updated through IERS Bulletin C52
+# File expires on: 28 June 2017
#
-#@ 3691872000
+#@ 3707596800
#
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
@@ -231,6 +231,7 @@
3439756800 34 # 1 Jan 2009
3550089600 35 # 1 Jul 2012
3644697600 36 # 1 Jul 2015
+3692217600 37 # 1 Jan 2017
#
# the following special comment contains the
# hash value of the data in this file computed
@@ -246,4 +247,4 @@
# the hash line is also ignored in the
# computation.
#
-#h afc03691 8ff53838 42080ba1 cdd22f1 48192c10
+#h dacf2c42 2c4765d6 3c797af8 2cf630eb 699c8c67
--
2.6.6

View File

@ -1,8 +1,35 @@
-------------------------------------------------------------------
Thu Sep 8 08:10:20 UTC 2016 - astieger@suse.com
Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com
- Turkey will remain on UTC+03 after 2016-10-30 bsc#997830
add turkey-bsc997830.patch
- timezone update 2016g:
* Turkey will remain on UTC+03 after 2016-10-30 bsc#997830
* New leap second 2016-12-31 23:59:60 UTC
Remove 0001-Positive-leap-second-on-2016-12-31.patch
* Corrections for past DST transitions
* Antarcica and nautical time zones now use numeric time zone
abbreviations instead of obsolete alphanumeric ones
* Renamed Asia/Rangoon to Asia/Yangon
* The following change was previously patched in the package
and is now upstream:
+ If the installed localtime and/or posixrules files are
symbolic links, zic now keeps them symbolic links when
updating them, for compatibility with platforms like
OpenSUSE where other programs configure these files as
symlinks.
+ zic now avoids hard linking to symbolic links, avoids
some unnecessary mkdir and stat system calls, and uses
shorter file names internally.
+ Drop the patches:
tzcode-fromname.patch
tzcode-link.diff
tzcode-revert-01-8c9cb9580.patch
tzcode-revert-02-301f794f3.patch
tzcode-revert-03-39fd078a6.patch
tzcode-symlink.patch
tzcode-zic.diff
* zdump has a new -i option to generate transitions in a
more-compact but still human-readable format. (experimental)(
- Drop upstream signatures and keyring, tarball generated from git
-------------------------------------------------------------------
Mon Aug 8 17:29:14 UTC 2016 - astieger@suse.com

View File

@ -25,28 +25,12 @@ License: BSD-3-Clause and SUSE-Public-Domain
Group: System/Base
# COMMON-BEGIN
# COMMON-BEGIN
Version: 2016f
Version: 2016g
Release: 0
Source: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz
Source1: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz
Source2: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz.asc
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
Patch2: tzcode-fromname.patch
Patch3: iso3166-uk.diff
Patch4: tzcode-link.diff
Patch5: tzcode-symlink.patch
# PATCH-FIX-UPSTREAM 0001-Positive-leap-second-on-2016-12-31.patch bsc#988184
Patch6: 0001-Positive-leap-second-on-2016-12-31.patch
# PATCH-FIX-UPSTREAM turkey-bsc997830.patch bsc#997890
Patch7: turkey-bsc997830.patch
# COMMON-END
# COMMON-END
Url: http://www.gnu.org/software/libc/libc.html
@ -66,20 +50,8 @@ package is intended for Java Virtual Machine based on OpenJDK.
%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
%patch3 -p1
%if 0%{?suse_version} < 1220
%patch4 -p1
%else
%patch5 -p1
%endif
%patch6 -p1
%patch7 -p1
sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358]
# COMMON-PREP-END
# COMMON-PREP-END

View File

@ -1,8 +1,35 @@
-------------------------------------------------------------------
Thu Sep 8 08:10:20 UTC 2016 - astieger@suse.com
Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com
- Turkey will remain on UTC+03 after 2016-10-30 bsc#997830
add turkey-bsc997830.patch
- timezone update 2016g:
* Turkey will remain on UTC+03 after 2016-10-30 bsc#997830
* New leap second 2016-12-31 23:59:60 UTC
Remove 0001-Positive-leap-second-on-2016-12-31.patch
* Corrections for past DST transitions
* Antarcica and nautical time zones now use numeric time zone
abbreviations instead of obsolete alphanumeric ones
* Renamed Asia/Rangoon to Asia/Yangon
* The following change was previously patched in the package
and is now upstream:
+ If the installed localtime and/or posixrules files are
symbolic links, zic now keeps them symbolic links when
updating them, for compatibility with platforms like
OpenSUSE where other programs configure these files as
symlinks.
+ zic now avoids hard linking to symbolic links, avoids
some unnecessary mkdir and stat system calls, and uses
shorter file names internally.
+ Drop the patches:
tzcode-fromname.patch
tzcode-link.diff
tzcode-revert-01-8c9cb9580.patch
tzcode-revert-02-301f794f3.patch
tzcode-revert-03-39fd078a6.patch
tzcode-symlink.patch
tzcode-zic.diff
* zdump has a new -i option to generate transitions in a
more-compact but still human-readable format. (experimental)(
- Drop upstream signatures and keyring, tarball generated from git
-------------------------------------------------------------------
Mon Aug 8 17:29:14 UTC 2016 - astieger@suse.com

View File

@ -1,28 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.5+
Comment: Hostname: keys2.kfwebs.net
mQENBFd7yYMBCADFWTwWRdWOZnZQG5cu6ZSJj47tyrXbSvwRinr2kGw7zP83YLFYLFt9HqzV
jeN1DXgWYaTPzrqg5ZK6h5YVoS+XLTMIAmMhgglXUtxuZ1bI97Qi48SVHQTtCBuOH/lVuqp1
AVroqW/iK9hzNrmXm+NNZ5OwhVo1kOlnp/B8/425DgCg9Xwt8dueYtlrmTpFn+so/MbfsXgf
6+r4Bip5/bYebz9IKRoH4zvX7SHYkXmC47UozuKKSIkh6Fc7gFnGtyDR7fy2wb9TR181PqPg
/anRBFpEegez4g0Nkglh5w8+l3pG/RFEAW7HBt3ee7+hMuNj23uoIH4KivBgMM6V0foBABEB
AAG0IFBhdWwgRWdnZXJ0IDxlZ2dlcnRAY3MudWNsYS5lZHU+iQE4BBMBAgAiBQJXe8mDAhsD
BgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAEPbY3RK1BjLtyB/90UnWXhNJLawcsjErp
ufHSwrM+vCXcn7X9pXqPfGY7fPxGwaClWUK2q6PG80NaNrncDihhc/NV3Avput7mrWw0o2GL
LHeDnqdGoddytXG3aO1uOkXOx4590p+Y7mtaD3AMCctQrm8n/6M2OEEHessxcJc4VpCznOXU
A/6mrom+VJvqkSaZEznMZmiZe5rA8zWp2GWKl1K0KJHtUZyDV4qlOtD+pNOm29yGJT0uCUuH
YFTx5PEcwuLnvJYosx33e82iPSKztb+9TchuAt7GiG05H8EQv4/+Yl6uBPFN1DUPezFpfqUo
jLh+J+2Sjt3zvLiS7nB/0nVzC94bnkYD2ujPuQENBFd7yYMBCACicN4ZgrhjxJAQ88wD/Ifn
Jh7c5O0xo8C9K4WLI/cPjo9Utybw+/C0wl2hDtx5no68U5Bw68n973SxGqZpNiJK201VwLHC
DpuDB1UPdmhgF58mDbchDoTEBbYxOJSLzy7eVcuISzm59Ui0vXRMT4dxoh808MxGk5dx7IaH
jwHc/DgEOk9tzk2pWY7mTe9xGfzTjU1KlrmAzL5vNz1IoVbBDRKuGUXLL6soY5BQQXyS874C
Pxk02QfIV+QLgET3is9Gw6J7wxQCxJwp53aHYxk/Uvp/VhoJJXNADVisH1IlL2ZJs8TfPTcp
xhSfU8+TNMcYwKdxnJ9fsl8pPBGayIY7ABEBAAGJAR8EGAECAAkFAld7yYMCGwwACgkQBD22
N0StQYxQDAgAsqemuGs020uYbP4fchwVy3bVgfQyVnobZhkg6z4vb9Wvw3f37sFBFsjPylMZ
doUuX2jpmVPZgYK4ENV8gJKsm6ocneit07kAdZRGxeP5Lkt2kAhrZ6/2YSKZkiMFH+0WN7Ch
1ITsLoxe++9WxIQGI66RgTxfnlLnbuEXhIO8Qjepa1LcI/k+Yh9gLdRgtan9VAg0C4r40Cip
Yzuf9mKImYIPlJpGKIb7SAQDIAcmOkWK8cbCL7XRsd0ZjTrBbPxlmB2nB9+g4L3dCe0TmRq4
SFM/8RjpqdxqdFknCMo4r9EaoagG0wbUKybbYHXiFD2bJ8ShriUwkp8vrInbj7cIww==
=+hBC
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -23,28 +23,12 @@ Group: System/Base
Url: http://www.iana.org/time-zones
PreReq: filesystem, coreutils
# COMMON-BEGIN
Version: 2016f
Version: 2016g
Release: 0
Source: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz
Source1: ftp://ftp.iana.org/tz/releases/tzcode%{version}.tar.gz
Source2: ftp://ftp.iana.org/tz/releases/tzdata%{version}.tar.gz.asc
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
Patch2: tzcode-fromname.patch
Patch3: iso3166-uk.diff
Patch4: tzcode-link.diff
Patch5: tzcode-symlink.patch
# PATCH-FIX-UPSTREAM 0001-Positive-leap-second-on-2016-12-31.patch bsc#988184
Patch6: 0001-Positive-leap-second-on-2016-12-31.patch
# PATCH-FIX-UPSTREAM turkey-bsc997830.patch bsc#997890
Patch7: turkey-bsc997830.patch
# COMMON-END
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -60,20 +44,8 @@ can select an appropriate time zone for your system with YaST.
%prep
%setup -q -c -a 1
# COMMON-PREP-BEGIN
%patch100 -p1 -R
%patch101 -p1 -R
%patch102 -p1 -R
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if 0%{?suse_version} < 1220
%patch4 -p1
%else
%patch5 -p1
%endif
%patch6 -p1
%patch7 -p1
sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358]
# COMMON-PREP-END

View File

@ -1,50 +0,0 @@
From 3e31dbe52b8730ed762880e88bf4c68ac00b8cc3 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 7 Sep 2016 23:35:52 -0700
Subject: [PATCH] Turkey switched from +02/+03 to permanent +03
The change is effective 2016-09-07. (Thanks to Burak AYDIN.)
* NEWS, europe (Europe/Istanbul): Document and implement this.
---
NEWS | 4 ++++
europe | 13 +++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
Index: timezone-2016f/europe
===================================================================
--- timezone-2016f.orig/europe 2016-09-08 10:13:12.543003440 +0200
+++ timezone-2016f/europe 2016-09-08 10:13:14.791024275 +0200
@@ -3472,6 +3472,14 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju
# Engineered Standard Time," said Twitter user @aysekarahasan.
# http://www.bbc.com/news/world-europe-34631326
+# From Burak AYDIN (2016-09-08):
+# Turkey will stay in Daylight Saving Time even in winter....
+# http://www.resmigazete.gov.tr/eskiler/2016/09/20160908-2.pdf
+#
+# From Paul Eggert (2016-09-07):
+# The change is permanent, so this is the new standard time in Turkey.
+# It takes effect today, which is not much notice.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Turkey 1916 only - May 1 0:00 1:00 S
Rule Turkey 1916 only - Oct 1 0:00 0 -
@@ -3535,7 +3543,7 @@ Rule Turkey 1996 2006 - Oct lastSun 1:00
Zone Europe/Istanbul 1:55:52 - LMT 1880
1:56:56 - IMT 1910 Oct # Istanbul Mean Time?
2:00 Turkey EE%sT 1978 Oct 15
- 3:00 Turkey TR%sT 1985 Apr 20 # Turkey Time
+ 3:00 Turkey +03/+04 1985 Apr 20 # Turkey Time
2:00 Turkey EE%sT 2007
2:00 EU EE%sT 2011 Mar 27 1:00u
2:00 - EET 2011 Mar 28 1:00u
@@ -3543,7 +3551,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
2:00 - EET 2014 Mar 31 1:00u
2:00 EU EE%sT 2015 Oct 25 1:00u
2:00 1:00 EEST 2015 Nov 8 1:00u
- 2:00 EU EE%sT
+ 2:00 EU EE%sT 2016 Sep 7
+ 3:00 - +03
Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine

View File

@ -1,27 +0,0 @@
Index: timezone-2016b/zic.c
===================================================================
--- 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) {
- const char *s = fromfield;
+ const char *s = fromname;
const char *t;
char *p;
size_t dotdots = 0;
@@ -777,10 +777,10 @@ dolink(char const *fromfield, char const
do
t = s;
while ((s = strchr(s, '/'))
- && ! strncmp (fromfield, tofield,
- ++s - fromfield));
+ && ! strncmp (fromname, tofield,
+ ++s - fromname));
- for (s = tofield + (t - fromfield); *s; s++)
+ for (s = tofield + (t - fromname); *s; s++)
dotdots += *s == '/';
symlinkcontents
= emalloc(3 * dotdots + strlen(t) + 1);

View File

@ -1,54 +0,0 @@
This patch is used on openSUSE versions older than 12.2.
Back then, /etc/localtime was either a hard link to a zone
file in /usr/share/zoneinfo or a copy of it.
By default, zic tries the following approaches to create
/etc/localtime:
1. Hard link
2. Symbolic link
3. File copy
This patch changes the order to:
1. Hard link
2. File copy
3. Symbolic link
Index: timezone-2015f/zic.c
===================================================================
--- timezone-2015f.orig/zic.c
+++ timezone-2015f/zic.c
@@ -738,6 +738,23 @@ relname(char const *dir, char const *bas
}
}
+static int
+copy(fromname, toname)
+const char * const fromname;
+const char * const toname;
+{
+ if (!fork()) {
+ execl("/bin/cp", "cp", fromname, toname, (char*) NULL);
+ _exit(1);
+ }
+ int s;
+ if (wait(&s) < 0)
+ return -1;
+ if (!WIFEXITED(s))
+ return -1;
+ return -WEXITSTATUS(s);
+}
+
static void
dolink(char const *fromfield, char const *tofield)
{
@@ -767,6 +784,8 @@ dolink(char const *fromfield, char const
exit(EXIT_FAILURE);
result = link(fromname, toname);
+ if (result != 0)
+ result = copy(fromname, toname);
if (result != 0) {
const char *s = fromname;
const char *t;

View File

@ -1,60 +0,0 @@
commit 8c9cb958078b470e352a58f7f2d756544051e59b
Author: Paul Eggert <eggert@cs.ucla.edu>
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 <time.h> does not declare asctime_r
# -DHAVE_DIRECT_H if mkdir needs <direct.h> (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;

View File

@ -1,96 +0,0 @@
commit 301f794f33d145b08fbf7f5247c8663d404fabb5
Author: Paul Eggert <eggert@cs.ucla.edu>
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): Dont 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.

View File

@ -1,319 +0,0 @@
commit 39fd078a694fa762de5ae7efceca1dbfb7be94b3
Author: Paul Eggert <eggert@cs.ucla.edu>
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 doesnt.
* 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): Dont 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): Dont remove files we cant 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 <direct.h> (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 <time.h> 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 <direct.h>
+# include <io.h>
+# undef mkdir
+# define mkdir(name, mode) _mkdir(name)
+#endif
+
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#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"),

View File

@ -1,89 +0,0 @@
This patch is used on openSUSE 12.2 or newer. Nowadays,
/etc/localtime is by default a symbolic link to a zone
file in /usr/share/zoneinfo.
By default, zic tries the following approaches to create
/etc/localtime:
1. Hard link
2. Symbolic link
3. File copy
This patch changes the logic slightly: keep using symbolic
links if /etc/localtime is already one. If it isn't, use
the default order as listed above.
Index: timezone-2015f/zic.c
===================================================================
--- timezone-2015f.orig/zic.c
+++ timezone-2015f/zic.c
@@ -105,7 +105,7 @@ static int addtype(zic_t, char const *,
static void leapadd(zic_t, bool, int, int);
static void adjleap(void);
static void associate(void);
-static void dolink(const char * fromfield, const char * tofield);
+static void dolink(const char * fromfield, const char * tofield, int defaultsymlink);
static char ** getfields(char * buf);
static zic_t gethms(const char * string, const char * errstring,
bool);
@@ -633,7 +633,7 @@ _("%s: More than one -L option specified
*/
for (i = 0; i < nlinks; ++i) {
eat(links[i].l_filename, links[i].l_linenum);
- dolink(links[i].l_from, links[i].l_to);
+ dolink(links[i].l_from, links[i].l_to, false);
if (noise)
for (j = 0; j < nlinks; ++j)
if (strcmp(links[i].l_to,
@@ -642,11 +642,11 @@ _("%s: More than one -L option specified
}
if (lcltime != NULL) {
eat(_("command line"), 1);
- dolink(lcltime, TZDEFAULT);
+ dolink(lcltime, TZDEFAULT, true);
}
if (psxrules != NULL) {
eat(_("command line"), 1);
- dolink(psxrules, TZDEFRULES);
+ dolink(psxrules, TZDEFRULES, false);
}
if (warnings && (ferror(stderr) || fclose(stderr) != 0))
return EXIT_FAILURE;
@@ -739,14 +739,17 @@ relname(char const *dir, char const *bas
}
static void
-dolink(char const *fromfield, char const *tofield)
+dolink(char const *fromfield, char const *tofield, int defaultsymlink)
{
+ struct stat st;
register char * fromname;
register char * toname;
register int fromisdir;
fromname = relname(directory, fromfield);
toname = relname(directory, tofield);
+ if (lstat(fromname, &st) == 0 && S_ISLNK(st.st_mode))
+ defaultsymlink = true;
/*
** We get to be careful here since
** there's a fair chance of root running us.
@@ -760,14 +763,14 @@ dolink(char const *fromfield, char const
}
if (itsdir(toname) <= 0)
remove(toname);
- if (link(fromname, toname) != 0) {
+ if (defaultsymlink || link(fromname, toname) != 0) {
int result;
if (! mkdirs(toname))
exit(EXIT_FAILURE);
-
- result = link(fromname, toname);
- if (result != 0) {
+ if (!defaultsymlink)
+ result = link(fromname, toname);
+ if ((defaultsymlink || (!defaultsymlink && result != 0))) {
const char *s = fromname;
const char *t;
char *p;

View File

@ -1,15 +0,0 @@
Index: timezone-2016b/zic.c
===================================================================
--- 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);
+#if 0
if (result == 0)
warning(_("hard link failed, symbolic link used"));
+#endif
free(symlinkcontents);
}
if (result != 0) {

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:72325f384490a310eeb2ea0fab7e6f011a5be19adab2ff9d83bf9d1993b066ed
size 194905

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABAgAGBQJXe8puAAoJEAQ9tjdErUGMYo8IAKif54YlyHHNdLSWzAseY1jf
80hiZG4bIDVNXD5qNAN5sIf7FexBNS9h/KB3H2xJ+47UZHfBqEIRSdNM3+1cFhPg
EZShIc8PKPkjS3/pxdR+7Sz/JWGDq1FyNCnBNoyRhKAcDWH3rsa2L7Q3hvkZ7Xcg
8DlhCcixLSX/rhJEs7k61FcGXivUkrht8trrvoTTBkoFpGUqt+x+cNan0z0qyiqF
PLQq7YJAjstGRsli97+P72WdJDRY6JL716slICKO5IYDki9xmpcBuj4l0bAxR+6c
PiZWlePe1TTyT0+shefy0eZmq1F7seTmkpAL7bhPR3E4ATYZfJfsMm6b/5seBFs=
=62wb
-----END PGP SIGNATURE-----

3
tzcode2016g.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ff10da5cf4a3c085fa92484d8cdef3133ed789cc24266245114bb78ca9f9d47
size 206198

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ed8c951008d12f1db55a11e96fc055718c6571233327d9de16a7f8475e2502b0
size 313286

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABAgAGBQJXe8p1AAoJEAQ9tjdErUGMmc0H/i837mGKBIJLmS1xtr64uaT+
LLLvI1gFTGJsqTaCya7aAVFlN/STM07otvYdkBDwQ6uIgjm8qAL33lGdi9IpTPp2
YOj03QkWpyPRFtM1A9EcsVkKOfezGSiY7WQiOEk7R05lH1SRBlZ+eXVQl9fhadrj
qCRkcCasVIDQWMKCOhSch1HyUuR+Z1Ujomi7Z4d0AyQbMKhB1yGxYKCVGzN8KaOK
AFr0Dd44p72dqgPdC/V7G0xjTNOpuM1zt8SdJuOE2EASRraIvnnQctmKlbYI8l8L
ANvy9xl+p8VkuZi7yuSoqVSLYTQDE8pAMsfg0DZpAbnjV1G07FxekBMdNzdr5/E=
=7jGR
-----END PGP SIGNATURE-----

3
tzdata2016g.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d98815c3de175b1545506b2c59719399d8a0a36a1e6a6c52e86109f3d692957d
size 319092