summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2017-11-03 12:54:35 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-04 11:11:57 +0000
commitaed6790dc2712d8cca692fbffe1c170cf96be7a4 (patch)
tree71592eec1070715674f1963ddb55d9d4c952bab9
parent42018607ea54e5b2a51ebc82d18ecad74d6038bd (diff)
downloadpoky-aed6790dc2712d8cca692fbffe1c170cf96be7a4.tar.gz
tzcode-native: update to 2017c
LICENSE changes do to rewording https://github.com/eggert/tz/commit/7097a652778d35acf747d14f8bf7b3ced479bbc0#diff-9879d6db96fd29134fc802214163b95a Backported to fixes from upstream too. Changes to code zic and the reference runtime now reject multiple leap seconds within 28 days of each other, or leap seconds before the Epoch. As a result, support for double leap seconds, which was obsolescent and undocumented, has been removed. Double leap seconds were an error in the C89 standard; they have never existed in civil timekeeping. (Thanks to Robert Elz and Bradley White for noticing glitches in the code that uncovered this problem.) zic now warns about use of the obsolescent and undocumented -y option, and about use of the obsolescent TYPE field of Rule lines. zic now allows unambiguous abbreviations like "Sa" and "Su" for weekdays; formerly it rejected them due to a bug. Conversely, zic no longer considers non-prefixes to be abbreviations; for example, it no longer accepts "lF" as an abbreviation for "lastFriday". Also, zic warns about the undocumented usage with a "last-" prefix, e.g., "last-Fri". Similarly, zic now accepts the unambiguous abbreviation "L" for "Link" in ordinary context and for "Leap" in leap-second context. Conversely, zic no longer accepts non-prefixes such as "La" as abbreviations for words like "Leap". zic no longer accepts leap second lines in ordinary input, or ordinary lines in leap second input. Formerly, zic sometimes warned about this undocumented usage and handled it incorrectly. The new macro HAVE_TZNAME governs whether the tzname external variable is exported, instead of USG_COMPAT. USG_COMPAT now governs only the external variables "timezone" and "daylight". This change is needed because the three variables are not in the same category: although POSIX requires tzname, it specifies the other two variables as optional. Also, USG_COMPAT is now 1 or 0: if not defined, the code attempts to guess it from other macros. localtime.c and difftime.c no longer require stdio.h, and .c files other than zic.c no longer require sys/wait.h. zdump.c no longer assumes snprintf. (Reported by Jonathan Leffler.) Calculation of time_t extrema works around a bug in GCC 4.8.4 (Reported by Stan Shebs and Joseph Myers.) zic.c no longer mistranslates formats of line numbers in non-English locales. (Problem reported by Benno Schulenberg.) Several minor changes have been made to the code to make it a bit easier to port to MS-Windows and Solaris. (Thanks to Kees Dekker for reporting the problems.) Changes to documentation and commentary The two new files 'theory.html' and 'calendars' contain the contents of the removed file 'Theory'. The goal is to document tzdb theory more accessibly. The zic man page now documents abbreviation rules. tz-link.htm now covers how to apply tzdata changes to clients. (Thanks to Jorge Fábregas for the AIX link.) It also mentions MySQL. The leap-seconds.list URL has been updated to something that is more reliable for tzdb. (Thanks to Tim Parenti and Brian Inglis.) (From OE-Core rev: 4082d75acbb1aa1145f56bb222d3f85adc90dd30) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 74af497f8d6b4e28d97c0f2cdb4ece90c2a6b8b5) Signed-off-by: Armin Kuster <akuster808@gmail.com> (cherry picked from commit 12a538bbbc8d04e875f81bd65e9754d749273aac) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/tzcode/files/0001-Fix-Makefile-quoting-bug.patch174
-rw-r--r--meta/recipes-extended/tzcode/files/0002-Port-zdump-to-C90-snprintf.patch115
-rw-r--r--meta/recipes-extended/tzcode/tzcode-native_2017c.bb (renamed from meta/recipes-extended/tzcode/tzcode-native_2017b.bb)15
3 files changed, 298 insertions, 6 deletions
diff --git a/meta/recipes-extended/tzcode/files/0001-Fix-Makefile-quoting-bug.patch b/meta/recipes-extended/tzcode/files/0001-Fix-Makefile-quoting-bug.patch
new file mode 100644
index 0000000000..e49fa09647
--- /dev/null
+++ b/meta/recipes-extended/tzcode/files/0001-Fix-Makefile-quoting-bug.patch
@@ -0,0 +1,174 @@
1From b520d20b8122a783f99f088758b78d928f70ee34 Mon Sep 17 00:00:00 2001
2From: Paul Eggert <eggert@cs.ucla.edu>
3Date: Mon, 23 Oct 2017 11:42:45 -0700
4Subject: [PATCH] Fix Makefile quoting bug
5
6Problem with INSTALLARGS reported by Zefram in:
7https://mm.icann.org/pipermail/tz/2017-October/025360.html
8Fix similar problems too.
9* Makefile (ZIC_INSTALL, VALIDATE_ENV, CC, install)
10(INSTALL, version, INSTALLARGS, right_posix, posix_right)
11(check_public): Use apostrophes to prevent undesirable
12interpretation of names by the shell. We still do not support
13directory names containing apostrophes or newlines, but this is
14good enough.
15
16Upstream-Status: Backport
17Signed-off-by: Armin Kuster <akuster@mvista.com>
18
19* NEWS: Mention this.
20---
21 Makefile | 64 ++++++++++++++++++++++++++++++++--------------------------------
22 NEWS | 8 ++++++++
23 2 files changed, 40 insertions(+), 32 deletions(-)
24
25diff --git a/Makefile b/Makefile
26index c92edc0..97649ca 100644
27--- a/Makefile
28+++ b/Makefile
29@@ -313,7 +313,7 @@ ZFLAGS=
30
31 # How to use zic to install tz binary files.
32
33-ZIC_INSTALL= $(ZIC) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
34+ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
35
36 # The name of a Posix-compliant 'awk' on your system.
37 AWK= awk
38@@ -341,8 +341,8 @@ SGML_CATALOG_FILES= \
39 VALIDATE = nsgmls
40 VALIDATE_FLAGS = -s -B -wall -wno-unused-param
41 VALIDATE_ENV = \
42- SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
43- SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
44+ SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
45+ SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
46 SP_CHARSET_FIXED=YES \
47 SP_ENCODING=UTF-8
48
49@@ -396,7 +396,7 @@ GZIPFLAGS= -9n
50 #MAKE= make
51
52 cc= cc
53-CC= $(cc) -DTZDIR=\"$(TZDIR)\"
54+CC= $(cc) -DTZDIR='"$(TZDIR)"'
55
56 AR= ar
57
58@@ -473,29 +473,29 @@ all: tzselect yearistype zic zdump libtz.a $(TABDATA)
59 ALL: all date $(ENCHILADA)
60
61 install: all $(DATA) $(REDO) $(MANS)
62- mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
63- $(DESTDIR)$(LIBDIR) \
64- $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
65- $(DESTDIR)$(MANDIR)/man8
66+ mkdir -p '$(DESTDIR)$(ETCDIR)' '$(DESTDIR)$(TZDIR)' \
67+ '$(DESTDIR)$(LIBDIR)' \
68+ '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
69+ '$(DESTDIR)$(MANDIR)/man8'
70 $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES)
71- cp -f $(TABDATA) $(DESTDIR)$(TZDIR)/.
72- cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
73- cp libtz.a $(DESTDIR)$(LIBDIR)/.
74- $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
75- cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
76- cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
77- cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
78+ cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
79+ cp tzselect zic zdump '$(DESTDIR)$(ETCDIR)/.'
80+ cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
81+ $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
82+ cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
83+ cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
84+ cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
85
86 INSTALL: ALL install date.1
87- mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
88- cp date $(DESTDIR)$(BINDIR)/.
89- cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
90+ mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
91+ cp date '$(DESTDIR)$(BINDIR)/.'
92+ cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
93
94 version: $(VERSION_DEPS)
95 { (type git) >/dev/null 2>&1 && \
96 V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
97 --abbrev=7 --dirty` || \
98- V=$(VERSION); } && \
99+ V='$(VERSION)'; } && \
100 printf '%s\n' "$$V" >$@.out
101 mv $@.out $@
102
103@@ -529,12 +529,12 @@ leapseconds: $(LEAP_DEPS)
104 # Arguments to pass to submakes of install_data.
105 # They can be overridden by later submake arguments.
106 INSTALLARGS = \
107- BACKWARD=$(BACKWARD) \
108- DESTDIR=$(DESTDIR) \
109+ BACKWARD='$(BACKWARD)' \
110+ DESTDIR='$(DESTDIR)' \
111 LEAPSECONDS='$(LEAPSECONDS)' \
112 PACKRATDATA='$(PACKRATDATA)' \
113- TZDIR=$(TZDIR) \
114- YEARISTYPE=$(YEARISTYPE) \
115+ TZDIR='$(TZDIR)' \
116+ YEARISTYPE='$(YEARISTYPE)' \
117 ZIC='$(ZIC)'
118
119 # 'make install_data' installs one set of tz binary files.
120@@ -558,16 +558,16 @@ right_only:
121 # You must replace all of $(TZDIR) to switch from not using leap seconds
122 # to using them, or vice versa.
123 right_posix: right_only
124- rm -fr $(DESTDIR)$(TZDIR)-leaps
125- ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
126- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
127- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
128+ rm -fr '$(DESTDIR)$(TZDIR)-leaps'
129+ ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
130+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
131+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
132
133 posix_right: posix_only
134- rm -fr $(DESTDIR)$(TZDIR)-posix
135- ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
136- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
137- $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
138+ rm -fr '$(DESTDIR)$(TZDIR)-posix'
139+ ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
140+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
141+ $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
142
143 # This obsolescent rule is present for backwards compatibility with
144 # tz releases 2014g through 2015g. It should go away eventually.
145@@ -764,7 +764,7 @@ set-timestamps.out: $(ENCHILADA)
146
147 check_public:
148 $(MAKE) maintainer-clean
149- $(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
150+ $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
151 mkdir -p public.dir
152 for i in $(TDATA) tzdata.zi; do \
153 $(zic) -v -d public.dir $$i 2>&1 || exit; \
154diff --git a/NEWS b/NEWS
155index bd2bec2..75ab095 100644
156--- a/NEWS
157+++ b/NEWS
158@@ -1,5 +1,13 @@
159 News for the tz database
160
161+Unreleased, experimental changes
162+
163+ Changes to build procedure
164+
165+ The Makefile now quotes values like BACKWARD more carefully when
166+ passing them to the shell. (Problem reported by Zefram.)
167+
168+
169 Release 2017c - 2017-10-20 14:49:34 -0700
170
171 Briefly:
172--
1732.7.4
174
diff --git a/meta/recipes-extended/tzcode/files/0002-Port-zdump-to-C90-snprintf.patch b/meta/recipes-extended/tzcode/files/0002-Port-zdump-to-C90-snprintf.patch
new file mode 100644
index 0000000000..87afe47694
--- /dev/null
+++ b/meta/recipes-extended/tzcode/files/0002-Port-zdump-to-C90-snprintf.patch
@@ -0,0 +1,115 @@
1From e231da4fb2beb17c60b4b1a5c276366d6a6e433f Mon Sep 17 00:00:00 2001
2From: Paul Eggert <eggert@cs.ucla.edu>
3Date: Mon, 23 Oct 2017 17:58:36 -0700
4Subject: [PATCH] Port zdump to C90 + snprintf
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Problem reported by Jon Skeet in:
10https://mm.icann.org/pipermail/tz/2017-October/025362.html
11* NEWS: Mention this.
12* zdump.c (my_snprintf): New macro or function. If a macro, it is
13just snprintf. If a function, it is the same as the old snprintf
14static function, with an ATTRIBUTE_FORMAT to pacify modern GCC.
15All uses of snprintf changed to use my_snprintf. This way,
16installers don’t need to specify -DHAVE_SNPRINTF if they are using
17a pre-C99 compiler with a library that has snprintf.
18
19Upstream-Status: Backport
20Signed-off-by: Armin Kuster <akuster@mvista.com>
21
22---
23 NEWS | 4 ++++
24 zdump.c | 29 ++++++++++++++++-------------
25 2 files changed, 20 insertions(+), 13 deletions(-)
26
27diff --git a/NEWS b/NEWS
28index 75ab095..dea08b8 100644
29--- a/NEWS
30+++ b/NEWS
31@@ -7,6 +7,10 @@ Unreleased, experimental changes
32 The Makefile now quotes values like BACKWARD more carefully when
33 passing them to the shell. (Problem reported by Zefram.)
34
35+ Builders no longer need to specify -DHAVE_SNPRINTF on platforms
36+ that have snprintf and use pre-C99 compilers. (Problem reported
37+ by Jon Skeet.)
38+
39
40 Release 2017c - 2017-10-20 14:49:34 -0700
41
42diff --git a/zdump.c b/zdump.c
43index 8e3bf3e..d4e6084 100644
44--- a/zdump.c
45+++ b/zdump.c
46@@ -795,12 +795,14 @@ show(timezone_t tz, char *zone, time_t t, bool v)
47 abbrok(abbr(tmp), zone);
48 }
49
50-#if !HAVE_SNPRINTF
51+#if HAVE_SNPRINTF
52+# define my_snprintf snprintf
53+#else
54 # include <stdarg.h>
55
56 /* A substitute for snprintf that is good enough for zdump. */
57-static int
58-snprintf(char *s, size_t size, char const *format, ...)
59+static int ATTRIBUTE_FORMAT((printf, 3, 4))
60+my_snprintf(char *s, size_t size, char const *format, ...)
61 {
62 int n;
63 va_list args;
64@@ -839,10 +841,10 @@ format_local_time(char *buf, size_t size, struct tm const *tm)
65 {
66 int ss = tm->tm_sec, mm = tm->tm_min, hh = tm->tm_hour;
67 return (ss
68- ? snprintf(buf, size, "%02d:%02d:%02d", hh, mm, ss)
69+ ? my_snprintf(buf, size, "%02d:%02d:%02d", hh, mm, ss)
70 : mm
71- ? snprintf(buf, size, "%02d:%02d", hh, mm)
72- : snprintf(buf, size, "%02d", hh));
73+ ? my_snprintf(buf, size, "%02d:%02d", hh, mm)
74+ : my_snprintf(buf, size, "%02d", hh));
75 }
76
77 /* Store into BUF, of size SIZE, a formatted UTC offset for the
78@@ -877,10 +879,10 @@ format_utc_offset(char *buf, size_t size, struct tm const *tm, time_t t)
79 mm = off / 60 % 60;
80 hh = off / 60 / 60;
81 return (ss || 100 <= hh
82- ? snprintf(buf, size, "%c%02ld%02d%02d", sign, hh, mm, ss)
83+ ? my_snprintf(buf, size, "%c%02ld%02d%02d", sign, hh, mm, ss)
84 : mm
85- ? snprintf(buf, size, "%c%02ld%02d", sign, hh, mm)
86- : snprintf(buf, size, "%c%02ld", sign, hh));
87+ ? my_snprintf(buf, size, "%c%02ld%02d", sign, hh, mm)
88+ : my_snprintf(buf, size, "%c%02ld", sign, hh));
89 }
90
91 /* Store into BUF (of size SIZE) a quoted string representation of P.
92@@ -983,15 +985,16 @@ istrftime(char *buf, size_t size, char const *time_fmt,
93 for (abp = ab; is_alpha(*abp); abp++)
94 continue;
95 len = (!*abp && *ab
96- ? snprintf(b, s, "%s", ab)
97+ ? my_snprintf(b, s, "%s", ab)
98 : format_quoted_string(b, s, ab));
99 if (s <= len)
100 return false;
101 b += len, s -= len;
102 }
103- formatted_len = (tm->tm_isdst
104- ? snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst)
105- : 0);
106+ formatted_len
107+ = (tm->tm_isdst
108+ ? my_snprintf(b, s, &"\t\t%d"[show_abbr], tm->tm_isdst)
109+ : 0);
110 }
111 break;
112 }
113--
1142.7.4
115
diff --git a/meta/recipes-extended/tzcode/tzcode-native_2017b.bb b/meta/recipes-extended/tzcode/tzcode-native_2017c.bb
index 165d2c6c7b..aeaef726bc 100644
--- a/meta/recipes-extended/tzcode/tzcode-native_2017b.bb
+++ b/meta/recipes-extended/tzcode/tzcode-native_2017c.bb
@@ -3,16 +3,19 @@
3SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect" 3SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
4LICENSE = "PD & BSD & BSD-3-Clause" 4LICENSE = "PD & BSD & BSD-3-Clause"
5 5
6LIC_FILES_CHKSUM = "file://LICENSE;md5=ef1a352b901ee7b75a75df8171d6aca7" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
7 7
8SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \ 8SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
9 http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata" 9 http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \
10 file://0001-Fix-Makefile-quoting-bug.patch \
11 file://0002-Port-zdump-to-C90-snprintf.patch"
12
10UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones" 13UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
11 14
12SRC_URI[tzcode.md5sum] = "afaf15deb13759e8b543d86350385b16" 15SRC_URI[tzcode.md5sum] = "2fe6986231db5182c61d565021a0cd7b"
13SRC_URI[tzcode.sha256sum] = "4d1735bb54e22b8d7443d4d1f1a13d007ae11be79a35e51f8e8322fb8e292d40" 16SRC_URI[tzcode.sha256sum] = "81e8b4bc23e60906640c266bbff3789661e22f0fa29fe61b96ec7c2816c079b7"
14SRC_URI[tzdata.md5sum] = "50dc0dc50c68644c1f70804f2e7a1625" 17SRC_URI[tzdata.md5sum] = "1e751e7e08f8b68530674f04619d894d"
15SRC_URI[tzdata.sha256sum] = "f8242a522ea3496b0ce4ff4f2e75a049178da21001a08b8e666d8cbe07d18086" 18SRC_URI[tzdata.sha256sum] = "d6543f92a929826318e2f44ff3a7611ce5f565a43e10250b42599d0ba4cbd90b"
16 19
17S = "${WORKDIR}" 20S = "${WORKDIR}"
18 21