summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bishop <stuart@stuartbishop.net>2013-10-02 10:54:59 +0700
committerStuart Bishop <stuart@stuartbishop.net>2013-10-02 10:54:59 +0700
commite0c961e4f7d72941424de6a0629e0fde0014d28e (patch)
tree3d9b3a133119aea4e368bbfe231c1c9737821b1b
parentce9e447b419de40105791f843d3238036ccc3dd1 (diff)
downloadpytz-e0c961e4f7d72941424de6a0629e0fde0014d28e.tar.gz
Import IANA 2013g
-rw-r--r--elsie.nci.nih.gov/src/Makefile64
-rw-r--r--elsie.nci.nih.gov/src/NEWS66
-rw-r--r--elsie.nci.nih.gov/src/README53
-rw-r--r--elsie.nci.nih.gov/src/africa45
-rw-r--r--elsie.nci.nih.gov/src/private.h4
-rw-r--r--elsie.nci.nih.gov/src/zic.c81
6 files changed, 218 insertions, 95 deletions
diff --git a/elsie.nci.nih.gov/src/Makefile b/elsie.nci.nih.gov/src/Makefile
index 4576092..7653278 100644
--- a/elsie.nci.nih.gov/src/Makefile
+++ b/elsie.nci.nih.gov/src/Makefile
@@ -6,7 +6,7 @@
PACKAGE= tzcode
# Version numbers of the code and data distributions.
-VERSION= 2013f
+VERSION= 2013g
# Email address for bug reports.
BUGEMAIL= tz@iana.org
@@ -107,6 +107,7 @@ LDLIBS=
# -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
# ctime_r and asctime_r incompatibly with the POSIX standard (Solaris 8).
# -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h"
+# -DHAVE_LINK=0 if your system lacks a link function
# -DHAVE_SETTIMEOFDAY=0 if settimeofday does not exist (SVR0?)
# -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4)
# -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD)
@@ -299,8 +300,8 @@ CC= $(cc) -DTZDIR=\"$(TZDIR)\"
TZCSRCS= zic.c localtime.c asctime.c scheck.c ialloc.c
TZCOBJS= zic.o localtime.o asctime.o scheck.o ialloc.o
-TZDSRCS= zdump.c localtime.c ialloc.c
-TZDOBJS= zdump.o localtime.o ialloc.o
+TZDSRCS= zdump.c localtime.c ialloc.c asctime.o
+TZDOBJS= zdump.o localtime.o ialloc.o asctime.c
DATESRCS= date.c localtime.c strftime.c asctime.c
DATEOBJS= date.o localtime.o strftime.o asctime.o
LIBSRCS= localtime.c asctime.c difftime.c
@@ -311,8 +312,12 @@ NEWUCBSRCS= date.c strftime.c
SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) tzselect.ksh
MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
tzfile.5 tzselect.8 zic.8 zdump.8
-COMMON= Makefile
-DOCS= NEWS README Theory $(MANS) date.1
+MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
+ time2posix.3.txt \
+ tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
+ date.1.txt
+COMMON= Makefile README
+DOCS= NEWS Theory $(MANS) date.1 $(MANTXTS)
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
YDATA= $(PRIMARY_YDATA) pacificnew etcetera backward
@@ -320,8 +325,9 @@ NDATA= systemv factory
SDATA= solar87 solar88 solar89
TDATA= $(YDATA) $(NDATA) $(SDATA)
TABDATA= iso3166.tab zone.tab
+LEAP_DEPS= leapseconds.awk leap-seconds.list
DATA= $(YDATA) $(NDATA) $(SDATA) $(TABDATA) \
- leap-seconds.list yearistype.sh
+ leapseconds $(LEAP_DEPS) yearistype.sh
WEB_PAGES= tz-art.htm tz-link.htm
AWK_SCRIPTS= checktab.awk leapseconds.awk
MISC= usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
@@ -382,7 +388,7 @@ yearistype: yearistype.sh
cp yearistype.sh yearistype
chmod +x yearistype
-leapseconds: leapseconds.awk leap-seconds.list
+leapseconds: $(LEAP_DEPS)
$(AWK) -f leapseconds.awk leap-seconds.list >$@
posix_only: zic $(TDATA)
@@ -460,22 +466,38 @@ clean: clean_misc
maintainer-clean: clean
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
- rm -f *.[1-8].txt *.asc *.tar.gz
+ rm -f $(MANTXTS) *.asc *.tar.gz
names:
@echo $(ENCHILADA)
public: check check_public check_time_t_alternatives \
- set-timestamps tarballs signatures
+ tarballs signatures
+
+date.1.txt: date.1
+newctime.3.txt: newctime.3
+newstrftime.3.txt: newstrftime.3
+newtzset.3.txt: newtzset.3
+time2posix.3.txt: time2posix.3
+tzfile.5.txt: tzfile.5
+tzselect.8.txt: tzselect.8
+zdump.8.txt: zdump.8
+zic.8.txt: zic.8
+
+$(MANTXTS): workman.sh
+ LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@
# Set the time stamps to those of the git repository, if available,
# and if the files have not changed since then.
# This uses GNU 'touch' syntax 'touch -d@N FILE',
# where N is the number of seconds since 1970.
# If git or GNU 'touch' is absent, do nothing and fail.
-set-timestamps:
- -files=`git ls-files` && \
- touch -d @1 test.out && rm -f test.out && \
+# Also, set the timestamp of each prebuilt file like 'leapseconds'
+# to be the maximum of the files it depends on.
+set-timestamps.out: $(ENCHILADA)
+ rm -f $@
+ -files=`git ls-files $(ENCHILADA)` && \
+ touch -md @1 test.out && rm -f test.out && \
for file in $$files; do \
if git diff --quiet $$file; then \
time=`git log -1 --format='tformat:%ct' $$file` && \
@@ -484,13 +506,19 @@ set-timestamps:
echo >&2 "$$file: warning: does not match repository"; \
fi || exit; \
done
+ touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
+ for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
+ touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
+ exit; \
+ done
+ touch $@
# The zics below ensure that each data file can stand on its own.
# We also do an all-files run to catch links to links.
check_public: $(ENCHILADA)
make maintainer-clean
- make "CFLAGS=$(GCC_DEBUG_FLAGS)"
+ make "CFLAGS=$(GCC_DEBUG_FLAGS)" $(ENCHILADA) all
mkdir tzpublic
for i in $(TDATA) ; do \
$(zic) -v -d tzpublic $$i 2>&1 || exit; \
@@ -529,17 +557,13 @@ check_time_t_alternatives:
tarballs: tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
-tzcode$(VERSION).tar.gz: $(COMMON) $(DOCS) $(SOURCES) $(MISC)
- for i in *.[1-8] ; do \
- LC_ALL=C sh workman.sh $$i > $$i.txt && \
- touch -r $$i $$i.txt || exit; \
- done
+tzcode$(VERSION).tar.gz: set-timestamps.out
LC_ALL=C && export LC_ALL && \
tar $(TARFLAGS) -cf - \
- $(COMMON) $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | \
+ $(COMMON) $(DOCS) $(SOURCES) $(MISC) | \
gzip $(GZIPFLAGS) > $@
-tzdata$(VERSION).tar.gz: $(COMMON) $(DATA)
+tzdata$(VERSION).tar.gz: set-timestamps.out
LC_ALL=C && export LC_ALL && \
tar $(TARFLAGS) -cf - $(COMMON) $(DATA) | \
gzip $(GZIPFLAGS) > $@
diff --git a/elsie.nci.nih.gov/src/NEWS b/elsie.nci.nih.gov/src/NEWS
index b56498b..8166141 100644
--- a/elsie.nci.nih.gov/src/NEWS
+++ b/elsie.nci.nih.gov/src/NEWS
@@ -1,6 +1,39 @@
News for the tz database
+Release 2013g - 2013-09-30 21:08:26 -0700
+
+ Changes affecting current and near-future time stamps
+
+ Morocco now observes DST from the last Sunday in March to the last
+ Sunday in October, not April to September respectively. (Thanks
+ to Steffen Thorsen.)
+
+ Changes affecting 'zic'
+
+ 'zic' now runs on platforms that lack both hard links and symlinks.
+ (Thanks to Theo Veenker for reporting the problem, for MinGW.)
+ Also, fix some bugs on platforms that lack hard links but have symlinks.
+
+ 'zic -v' again warns that Asia/Tehran has no POSIX environment variable
+ to predict the far future, fixing a bug introduced in 2013e.
+
+ Changes affecting the build procedure
+
+ The 'leapseconds' file is again put into the tzdata tarball.
+ Also, 'leapseconds.awk', so tzdata is self-contained. (Thanks to
+ Matt Burgess and Ian Abbott.) The timestamps of these and other
+ dependent files in tarballs are adjusted more consistently.
+
+ Changes affecting documentation and commentary
+
+ The README file is now part of the data tarball as well as the code.
+ It now states that files are public domain unless otherwise specified.
+ (Thanks to Andrew Main (Zefram) for asking for clarifications.)
+ Its details about the 1989 release moved to a place of honor near
+ the end of NEWS.
+
+
Release 2013f - 2013-09-24 23:37:36 -0700
Changes affecting near-future time stamps
@@ -2103,6 +2136,37 @@ Release 92 - 1992-04-25 18:17:03 -0000
By popular demand (well, at any rate, following a request by kre at munnari)
+The 1989 update of the time zone package featured:
+
+ * POSIXization (including interpretation of POSIX-style TZ environment
+ variables, provided by Guy Harris),
+ * ANSIfication (including versions of "mktime" and "difftime"),
+ * SVIDulation (an "altzone" variable)
+ * MACHination (the "gtime" function)
+ * corrections to some time zone data (including corrections to the rules
+ for Great Britain and New Zealand)
+ * reference data from the United States Naval Observatory for folks who
+ want to do additional time zones
+ * and the 1989 data for Saudi Arabia.
+
+ (Since this code will be treated as "part of the implementation" in some
+ places and as "part of the application" in others, there's no good way to
+ name functions, such as timegm, that are not part of the proposed ANSI C
+ standard; such functions have kept their old, underscore-free names in this
+ update.)
+
+ And the "dysize" function has disappeared; it was present to allow
+ compilation of the "date" command on old BSD systems, and a version of "date"
+ is now provided in the package. The "date" command is not created when you
+ "make all" since it may lack options provided by the version distributed with
+ your operating system, or may not interact with the system in the same way
+ the native version does.
+
+ Since POSIX frowns on correct leap second handling, the default behavior of
+ the "zic" command (in the absence of a "-L" option) has been changed to omit
+ leap second information from its output files.
+
+
-----
Notes
@@ -2124,3 +2188,5 @@ the release (if all else fails; these are marked with a timezone of
Earlier versions of the code and data were not announced on the tz
list and are not summarized here.
+
+This file is in the public domain.
diff --git a/elsie.nci.nih.gov/src/README b/elsie.nci.nih.gov/src/README
index 091384c..0b0bbbe 100644
--- a/elsie.nci.nih.gov/src/README
+++ b/elsie.nci.nih.gov/src/README
@@ -1,40 +1,18 @@
README for the tz distribution
-This file is in the public domain, so clarified as of
-2009-05-17 by Arthur David Olson.
-
"What time is it?" -- Richard Deacon as The King
"Any time you want it to be." -- Frank Baxter as The Scientist
(from the Bell System film "About Time")
-The 1989 update of the time zone package featured
-
-* POSIXization (including interpretation of POSIX-style TZ environment
- variables, provided by Guy Harris),
-* ANSIfication (including versions of "mktime" and "difftime"),
-* SVIDulation (an "altzone" variable)
-* MACHination (the "gtime" function)
-* corrections to some time zone data (including corrections to the rules
- for Great Britain and New Zealand)
-* reference data from the United States Naval Observatory for folks who
- want to do additional time zones
-* and the 1989 data for Saudi Arabia.
-
-(Since this code will be treated as "part of the implementation" in some places
-and as "part of the application" in others, there's no good way to name
-functions, such as timegm, that are not part of the proposed ANSI C standard;
-such functions have kept their old, underscore-free names in this update.)
+The Time Zone Database (often called tz or zoneinfo) contains code and
+data that represent the history of local time for many representative
+locations around the globe. It is updated periodically to reflect
+changes made by political bodies to time zone boundaries, UTC offsets,
+and daylight-saving rules.
-And the "dysize" function has disappeared; it was present to allow compilation
-of the "date" command on old BSD systems, and a version of "date" is now
-provided in the package. The "date" command is not created when you "make all"
-since it may lack options provided by the version distributed with your
-operating system, or may not interact with the system in the same way the
-native version does.
-
-Since POSIX frowns on correct leap second handling, the default behavior of
-the "zic" command (in the absence of a "-L" option) has been changed to omit
-leap second information from its output files.
+Unless otherwise specified, all files in the tz code and data are in
+the public domain, so clarified as of 2009-05-17 by Arthur David Olson.
+The few exceptions are code derived from BSD, which uses the BSD license.
Here is a recipe for acquiring, building, installing, and testing the
tz distribution on a GNU/Linux or similar host.
@@ -53,8 +31,6 @@ substituting your desired installation directory for "$HOME/tzdir":
make TOPDIR=$HOME/tzdir install
$HOME/tzdir/etc/zdump -v America/Los_Angeles
-To use the new functions, use a "-ltz" option when compiling or linking.
-
Historical local time information has been included here to:
* provide a compendium of data about the history of civil time
@@ -71,7 +47,7 @@ The information in the time zone data files is by no means authoritative;
the files currently do not even attempt to cover all time stamps before
1970, and there are undoubtedly errors even for time stamps since 1970.
If you know that the rules are different from those in a file, by all means
-feel free to change file (and please send the changed version to
+feel free to change a file (and please send the changed version to
tz@iana.org for use in the future). Europeans take note!
Thanks to these Timezone Caballeros who've made major contributions to the
@@ -79,15 +55,10 @@ time conversion package: Keith Bostic; Bob Devine; Paul Eggert; Robert Elz;
Guy Harris; Mark Horton; John Mackin; and Bradley White. Thanks also to
Michael Bloom, Art Neilson, Stephen Prince, John Sovereign, and Frank Wales
for testing work, and to Gwillim Law for checking local mean time data.
+Thanks in particular to Arthur David Olson, the project's founder and first
+maintainer, to whom the timezone community owes the greatest debt of all.
None of them are responsible for remaining errors.
-Look in <ftp://ftp.iana.org/tz/releases/>
-for updated versions of these files.
+Look in <ftp://ftp.iana.org/tz/releases/> for updated versions of these files.
Please send comments or information to tz@iana.org.
-
-Postscript: The README above is largely unmodified (aside from details
-of mailing list and ftp archive addresses) from that prepared many years
-ago by Arthur David Olson, to whom the timezone community owes the
-greatest debt of all. Arthur is not currently maintaining this data or
-code (though he remains involved).
diff --git a/elsie.nci.nih.gov/src/africa b/elsie.nci.nih.gov/src/africa
index 9a5d93b..20b00eb 100644
--- a/elsie.nci.nih.gov/src/africa
+++ b/elsie.nci.nih.gov/src/africa
@@ -858,13 +858,23 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# transitions would be 2013-07-07 and 2013-08-10; see:
# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
-# From Paul Eggert (2013-07-03):
+# From Steffen Thorsen (2013-09-28):
+# Morocco extends DST by one month, on very short notice, just 1 day
+# before it was going to end. There is a new decree (2.13.781) for
+# this, where DST from now on goes from last Sunday of March at 02:00
+# to last Sunday of October at 03:00, similar to EU rules. Official
+# source (French):
+# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013
+# Another source (specifying the time for start and end in the decree):
+# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
+
+# From Paul Eggert (2013-09-30):
# To estimate what the Moroccan government will do in future years,
-# transition dates for 2014 through 2021 were determined by running
+# transition dates for 2014 through 2037 were determined by running
# the following program under GNU Emacs 24.3:
#
# (let ((islamic-year 1435))
-# (while (< islamic-year 1444)
+# (while (< islamic-year 1460)
# (let ((a
# (calendar-gregorian-from-absolute
# (calendar-islamic-to-absolute (list 9 1 islamic-year))))
@@ -879,13 +889,14 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
# (setq islamic-year (+ 1 islamic-year))))
#
-# with the results hand-edited for 2020-2022, when the normal spring-forward
-# date falls during the estimated Ramadan.
-#
-# From 2023 through 2038 Ramadan is not predicted to overlap with
-# daylight saving time. Starting in 2039 there will be overlap again,
+# with spring-forward transitions removed for 2023-2025, when the
+# normal spring-forward date falls during the estimated Ramadan; with
+# all transitions removed for 2026-2035, where the estimated Ramadan
+# falls entirely outside daylight-saving time; and with fall-back
+# transitions removed for 2036-2037, where the normal fall-back
+# date falls during the estimated Ramadan. Problems continue after that,
# but 32-bit time_t values roll around in 2038 so for now do not worry
-# about dates after 2038.
+# about dates after 2037.
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@@ -912,12 +923,14 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S
Rule Morocco 2010 only - Aug 8 0:00 0 -
Rule Morocco 2011 only - Apr 3 0:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 -
-Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S
-Rule Morocco 2012 max - Sep lastSun 3:00 0 -
+Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S
+Rule Morocco 2012 only - Sep 30 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
Rule Morocco 2013 only - Jul 7 3:00 0 -
Rule Morocco 2013 only - Aug 10 2:00 1:00 S
+Rule Morocco 2013 2035 - Oct lastSun 3:00 0 -
+Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S
Rule Morocco 2014 only - Jun 29 3:00 0 -
Rule Morocco 2014 only - Jul 29 2:00 1:00 S
Rule Morocco 2015 only - Jun 18 3:00 0 -
@@ -930,10 +943,18 @@ Rule Morocco 2018 only - May 16 3:00 0 -
Rule Morocco 2018 only - Jun 15 2:00 1:00 S
Rule Morocco 2019 only - May 6 3:00 0 -
Rule Morocco 2019 only - Jun 5 2:00 1:00 S
+Rule Morocco 2020 only - Apr 24 3:00 0 -
Rule Morocco 2020 only - May 24 2:00 1:00 S
+Rule Morocco 2021 only - Apr 13 3:00 0 -
Rule Morocco 2021 only - May 13 2:00 1:00 S
+Rule Morocco 2022 only - Apr 3 3:00 0 -
Rule Morocco 2022 only - May 3 2:00 1:00 S
-Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S
+Rule Morocco 2023 only - Apr 22 2:00 1:00 S
+Rule Morocco 2024 only - Apr 10 2:00 1:00 S
+Rule Morocco 2025 only - Mar 31 2:00 1:00 S
+Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S
+Rule Morocco 2036 only - Oct 21 3:00 0 -
+Rule Morocco 2037 only - Oct 11 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
diff --git a/elsie.nci.nih.gov/src/private.h b/elsie.nci.nih.gov/src/private.h
index 3a19305..4eb0ab6 100644
--- a/elsie.nci.nih.gov/src/private.h
+++ b/elsie.nci.nih.gov/src/private.h
@@ -34,6 +34,10 @@
#define HAVE_INCOMPATIBLE_CTIME_R 0
#endif /* !defined INCOMPATIBLE_CTIME_R */
+#ifndef HAVE_LINK
+#define HAVE_LINK 1
+#endif /* !defined HAVE_LINK */
+
#ifndef HAVE_SETTIMEOFDAY
#define HAVE_SETTIMEOFDAY 3
#endif /* !defined HAVE_SETTIMEOFDAY */
diff --git a/elsie.nci.nih.gov/src/zic.c b/elsie.nci.nih.gov/src/zic.c
index 7e231b5..e7b0081 100644
--- a/elsie.nci.nih.gov/src/zic.c
+++ b/elsie.nci.nih.gov/src/zic.c
@@ -107,6 +107,13 @@ extern int link(const char * fromname, const char * toname);
extern char * optarg;
extern int optind;
+#if ! HAVE_LINK
+# define link(from, to) (-1)
+#endif
+#if ! HAVE_SYMLINK
+# define symlink(from, to) (-1)
+#endif
+
static void addtt(zic_t starttime, int type);
static int addtype(zic_t gmtoff, const char * abbr, int isdst,
int ttisstd, int ttisgmt);
@@ -612,41 +619,71 @@ dolink(const char *const fromfield, const char *const tofield)
*/
if (!itsdir(toname))
(void) remove(toname);
- if (link(fromname, toname) != 0) {
+ if (link(fromname, toname) != 0
+ && access(fromname, F_OK) == 0 && !itsdir(fromname)) {
int result;
if (mkdirs(toname) != 0)
exit(EXIT_FAILURE);
result = link(fromname, toname);
-#if HAVE_SYMLINK
- if (result != 0 &&
- access(fromname, F_OK) == 0 &&
- !itsdir(fromname)) {
- const char *s = tofield;
+ if (result != 0) {
+ const char *s = fromfield;
+ const char *t;
register char * symlinkcontents = NULL;
- while ((s = strchr(s+1, '/')) != NULL)
+ do
+ t = s;
+ while ((s = strchr(s, '/'))
+ && ! strncmp (fromfield, tofield,
+ ++s - fromfield));
+
+ for (s = tofield + (t - fromfield);
+ (s = strchr(s, '/'));
+ s++)
symlinkcontents =
ecatalloc(symlinkcontents,
"../");
- symlinkcontents =
- ecatalloc(symlinkcontents,
- fromname);
- result = symlink(symlinkcontents,
- toname);
+ symlinkcontents = ecatalloc(symlinkcontents, t);
+ result = symlink(symlinkcontents, toname);
if (result == 0)
warning(_("hard link failed, symbolic link used"));
free(symlinkcontents);
}
-#endif /* HAVE_SYMLINK */
if (result != 0) {
- const char *e = strerror(errno);
-
- (void) fprintf(stderr,
- _("%s: Can't link from %s to %s: %s\n"),
- progname, fromname, toname, e);
- exit(EXIT_FAILURE);
+ FILE *fp, *tp;
+ int c;
+ fp = fopen(fromname, "rb");
+ if (!fp) {
+ const char *e = strerror(errno);
+ (void) fprintf(stderr,
+ _("%s: Can't read %s: %s\n"),
+ progname, fromname, e);
+ exit(EXIT_FAILURE);
+ }
+ tp = fopen(toname, "wb");
+ if (!tp) {
+ const char *e = strerror(errno);
+ (void) fprintf(stderr,
+ _("%s: Can't create %s: %s\n"),
+ progname, toname, e);
+ exit(EXIT_FAILURE);
+ }
+ while ((c = getc(fp)) != EOF)
+ putc(c, tp);
+ if (ferror(fp) || fclose(fp)) {
+ (void) fprintf(stderr,
+ _("%s: Error reading %s\n"),
+ progname, fromname);
+ exit(EXIT_FAILURE);
+ }
+ if (ferror(tp) || fclose(tp)) {
+ (void) fprintf(stderr,
+ _("%s: Error writing %s\n"),
+ progname, toname);
+ exit(EXIT_FAILURE);
+ }
+ warning(_("link failed, copy used"));
}
}
free(fromname);
@@ -2062,12 +2099,12 @@ outzone(const struct zone * const zpfirst, const int zonecount)
compat = stringzone(envvar, zpfirst, zonecount);
version = compat < 2013 ? ZIC_VERSION_PRE_2013 : ZIC_VERSION;
do_extend = compat < 0 || compat == YEAR_BY_YEAR_ZONE;
- if (noise && compat != 0 && compat != YEAR_BY_YEAR_ZONE) {
- if (compat < 0)
+ if (noise) {
+ if (!*envvar)
warning("%s %s",
_("no POSIX environment variable for zone"),
zpfirst->z_name);
- else {
+ else if (compat != 0 && compat != YEAR_BY_YEAR_ZONE) {
/* Circa-COMPAT clients, and earlier clients, might
not work for this zone when given dates before
1970 or after 2038. */