From c0bf54089c7d7853f99cf7c787f779492e4191ffe0d7d8a5eafeb77840cd2658 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Wed, 28 Sep 2016 19:42:26 +0000 Subject: [PATCH 1/7] - use IANA released tarballs, verify signature OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=190 --- timezone-java.changes | 5 ++++ timezone-java.keyring | 58 ++++++++++++++++++++++++++++++++++++++++++ timezone-java.spec | 8 ++++-- timezone.changes | 5 ++++ timezone.keyring | 58 ++++++++++++++++++++++++++++++++++++++++++ timezone.spec | 8 ++++-- tzcode2016g.tar.gz | 4 +-- tzcode2016g.tar.gz.asc | 17 +++++++++++++ tzdata2016g.tar.gz | 4 +-- tzdata2016g.tar.gz.asc | 17 +++++++++++++ 10 files changed, 176 insertions(+), 8 deletions(-) create mode 100644 timezone-java.keyring create mode 100644 timezone.keyring create mode 100644 tzcode2016g.tar.gz.asc create mode 100644 tzdata2016g.tar.gz.asc diff --git a/timezone-java.changes b/timezone-java.changes index 8f416a0..aeceb8d 100644 --- a/timezone-java.changes +++ b/timezone-java.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 28 19:41:23 UTC 2016 - astieger@suse.com + +- use IANA released tarballs, verify signature + ------------------------------------------------------------------- Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com diff --git a/timezone-java.keyring b/timezone-java.keyring new file mode 100644 index 0000000..9a73162 --- /dev/null +++ b/timezone-java.keyring @@ -0,0 +1,58 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: SKS 1.1.5 +Comment: Hostname: pgp.mit.edu + +mQINBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 +Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS +96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd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DdHrqHH767jaDaTB1+Talp/2A +MKwcXNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL +2omu5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSf +uGCB1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCH +jnV0q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkG +oi8buNcby4U= +=w6kQ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/timezone-java.spec b/timezone-java.spec index f420b5c..ba45c0e 100644 --- a/timezone-java.spec +++ b/timezone-java.spec @@ -27,8 +27,12 @@ Group: System/Base # COMMON-BEGIN Version: 2016g Release: 0 -Source: tzdata%{version}.tar.gz -Source1: tzcode%{version}.tar.gz +Source: https://www.iana.org/time-zones/repository/releases/tzdata%{version}.tar.gz +Source1: https://www.iana.org/time-zones/repository/releases/tzcode%{version}.tar.gz +Source2: https://www.iana.org/time-zones/repository/releases/tzdata%{version}.tar.gz.asc +Source3: https://www.iana.org/time-zones/repository/releases/tzcode%{version}.tar.gz.asc +Source4: %{name}.keyring +Source5: %{name}.changes Patch0: tzdata-china.diff Patch3: iso3166-uk.diff # COMMON-END diff --git a/timezone.changes b/timezone.changes index 8f416a0..aeceb8d 100644 --- a/timezone.changes +++ b/timezone.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 28 19:41:23 UTC 2016 - astieger@suse.com + +- use IANA released tarballs, verify signature + ------------------------------------------------------------------- Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com diff --git a/timezone.keyring b/timezone.keyring new file mode 100644 index 0000000..9a73162 --- /dev/null +++ b/timezone.keyring @@ -0,0 +1,58 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: SKS 1.1.5 +Comment: Hostname: pgp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PnUOs +Q0KOFxHXXYHmRrS1OZPU59BLvc+TRhIhafSHKLwbXK+6ckkxBx6h8z5ccpG0Qs4bFhdFYnFr +EieDLoGmnE2YLhdV6swJ9VNCS6pLiEohT3fm7aXm15tZOIyzMZhHRSAPblXxQ0ZSWjq8oRrc +YNFxc4W1URpAkBCOYJoXvQfD5L3lqAl8TCqDUzYxhH/tJhbDdHrqHH767jaDaTB1+Talp/2A +MKwcXNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL +2omu5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSf +uGCB1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCH +jnV0q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkG +oi8buNcby4U= +=w6kQ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/timezone.spec b/timezone.spec index 8452945..5d4a68b 100644 --- a/timezone.spec +++ b/timezone.spec @@ -25,8 +25,12 @@ PreReq: filesystem, coreutils # COMMON-BEGIN Version: 2016g Release: 0 -Source: tzdata%{version}.tar.gz -Source1: tzcode%{version}.tar.gz +Source: https://www.iana.org/time-zones/repository/releases/tzdata%{version}.tar.gz +Source1: https://www.iana.org/time-zones/repository/releases/tzcode%{version}.tar.gz +Source2: https://www.iana.org/time-zones/repository/releases/tzdata%{version}.tar.gz.asc +Source3: https://www.iana.org/time-zones/repository/releases/tzcode%{version}.tar.gz.asc +Source4: %{name}.keyring +Source5: %{name}.changes Patch0: tzdata-china.diff Patch3: iso3166-uk.diff # COMMON-END diff --git a/tzcode2016g.tar.gz b/tzcode2016g.tar.gz index 3a1c2d4..ee715aa 100644 --- a/tzcode2016g.tar.gz +++ b/tzcode2016g.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ff10da5cf4a3c085fa92484d8cdef3133ed789cc24266245114bb78ca9f9d47 -size 206198 +oid sha256:1ff90b47ad7986140a513b5287b1851c40f80fd44fd636db5cc5b46d06f9fa2b +size 203362 diff --git a/tzcode2016g.tar.gz.asc b/tzcode2016g.tar.gz.asc new file mode 100644 index 0000000..417fd62 --- /dev/null +++ b/tzcode2016g.tar.gz.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQIcBAABAgAGBQJX2CTkAAoJEO2X6Q5iqn40/dsQAKZVDkj6jZNmdcS3qfArD30Z +U9K7AwLUlugG6WuwMzPYPp2zMNhdM3pVdfSrtgNPjGBJY4kISIiSnNx8CuvNUxlf +u+gnsPkr2qfEMEhjEKS9K4yeBi12Bo3WX7lxFJDSqXfQM389EIQufLdcpggQVnoZ +mbUCSGS3P+C+JCZBr3ltc6dZVo3OofduZR6rZauyKdHLsFo3UZgo3HZ1AgADU5KB +b+8JUAUMssOFr9dp61mF1WBlhHrg7+SubCZe5a4QggON73prhCQWtNFH/de76Ep0 +vpjn9y8dbzjSGEuMGxRRH7aBN1XYOiTyBEO3rXYA5J93I7C0IXRD3hALCpqJH/+F +dw3lzEOHi7drX/WPS2eHYaHV6GtXs8BpU39lzPiyQ89ZwFDI+ed+IFx0F2nhGI4a +YnncsPwHtodhK5AnTifDA9F95MuAZiILBlMLklaFicbtVuptM/pHgSRKKbkjptfR +3M8XmCgw/1zOAyMvc0D7X5YBspKacXDnMNX4jGDtdKoDiUAEjNf2w4RXV9fYg7Wa +5RgcqqhAcSW1SpyUcHo+po6oXTELaBh7+QGPKqsdG8ntbaywqYNT6oJqkLtYzyVj +sraRd7+f0EXdgrYTi6rZim/v6VudEqGGBRVfenXzQPCwtaNY1/+UW+Ruo/Yqlo9k +Cs4QYazop8GmeH74lAIx +=+WWr +-----END PGP SIGNATURE----- diff --git a/tzdata2016g.tar.gz b/tzdata2016g.tar.gz index ab53b01..592ab3b 100644 --- a/tzdata2016g.tar.gz +++ b/tzdata2016g.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d98815c3de175b1545506b2c59719399d8a0a36a1e6a6c52e86109f3d692957d -size 319092 +oid sha256:3c7137b2bc47323b0de47b77786bacf81ed503d4b2c693ff8ada2fbd1281ebd1 +size 316669 diff --git a/tzdata2016g.tar.gz.asc b/tzdata2016g.tar.gz.asc new file mode 100644 index 0000000..674f325 --- /dev/null +++ b/tzdata2016g.tar.gz.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQIcBAABAgAGBQJX2CTkAAoJEO2X6Q5iqn40i8IP/jtQ8PYjBG3NJV5uvRGzbV60 +n1vdVJDMU9SkRpiT1G8p/cjr4mszUnm+qsZNZGg1wZknBuQdnglAMwA2lj8Llv5N +gAlGj/JDEsNESfOC+9wD+NtZK+aUxJzHSXl4xzhzCMjBKaPOytcLKuGscMrpcGFH +2IDyjdjHOfDNG5PAxu0wjkMsKFUt95wmuWzPu1x48EqCF5c2zhanQI3mrugnmLwm +MAnq69E+z1q/5WLOzZEfRGXm98BpS90PC89fWwiKdKciHvTVFO9XLz9pknaeRP4N +uNcGoF0zEB+unAKoQmMI248sQZ1DzQGRC/niZ9SG70xHSdtBQF19B4oNoh27h3jz +j2ZF262PZCL6J5SoEISqXRFkiZbRFR79uwUA5LQRyFWu4gg63wk85+gx8BjxwbPP +bUVtV4IBRScFdVC7Li3Xw5PF8cwfQRf0JAxTdtwSgY9tC2pEjomCkb9mzSMDz78w +CSFl6yNuL44atUmHK0XFCNIJnyoG0hNrIWwOx/zmlYnaX9Iqm6H9LmXaUcV3rg0N +uKaTWuvZQzgxRwbrq0NxH8O/B1LWmdOls4ZGoMboVpTracg6APATXJIaQjm+RKjH +EGtDiihPYP/WbrCg823uVPNHCbyoMcFrZB34ujjO89ObH8BsLJKmnUeQUCw74mok +D92yWr5OAzGJYJFpgUNr +=WYLD +-----END PGP SIGNATURE----- From f1db3be32592aacfbbb877194d82158ff98773227f5b5f76c822b5e143b890af Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Thu, 6 Oct 2016 13:29:00 +0000 Subject: [PATCH 2/7] OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=192 --- 0001-Positive-leap-second-on-2016-12-31.patch | 66 ++++ tzcode-fromname.patch | 27 ++ tzcode-link.diff | 54 +++ tzcode-revert-01-8c9cb9580.patch | 60 ++++ tzcode-revert-02-301f794f3.patch | 96 ++++++ tzcode-revert-03-39fd078a6.patch | 319 ++++++++++++++++++ tzcode-symlink.patch | 89 +++++ tzcode-zic.diff | 15 + tzcode2016f.tar.gz | 3 + tzcode2016f.tar.gz.asc | 11 + tzdata2016f.tar.gz | 3 + tzdata2016f.tar.gz.asc | 11 + 12 files changed, 754 insertions(+) create mode 100644 0001-Positive-leap-second-on-2016-12-31.patch create mode 100644 tzcode-fromname.patch create mode 100644 tzcode-link.diff create mode 100644 tzcode-revert-01-8c9cb9580.patch create mode 100644 tzcode-revert-02-301f794f3.patch create mode 100644 tzcode-revert-03-39fd078a6.patch create mode 100644 tzcode-symlink.patch create mode 100644 tzcode-zic.diff create mode 100644 tzcode2016f.tar.gz create mode 100644 tzcode2016f.tar.gz.asc create mode 100644 tzdata2016f.tar.gz create mode 100644 tzdata2016f.tar.gz.asc diff --git a/0001-Positive-leap-second-on-2016-12-31.patch b/0001-Positive-leap-second-on-2016-12-31.patch new file mode 100644 index 0000000..1f60c2e --- /dev/null +++ b/0001-Positive-leap-second-on-2016-12-31.patch @@ -0,0 +1,66 @@ +From 6d5fc7fed0690f22574a9b795575e2bb7962716c Mon Sep 17 00:00:00 2001 +From: Tim Parenti +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 +. +--- + 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 + diff --git a/tzcode-fromname.patch b/tzcode-fromname.patch new file mode 100644 index 0000000..f9d913d --- /dev/null +++ b/tzcode-fromname.patch @@ -0,0 +1,27 @@ +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); diff --git a/tzcode-link.diff b/tzcode-link.diff new file mode 100644 index 0000000..e5ac3f2 --- /dev/null +++ b/tzcode-link.diff @@ -0,0 +1,54 @@ +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; diff --git a/tzcode-revert-01-8c9cb9580.patch b/tzcode-revert-01-8c9cb9580.patch new file mode 100644 index 0000000..809499b --- /dev/null +++ b/tzcode-revert-01-8c9cb9580.patch @@ -0,0 +1,60 @@ +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; diff --git a/tzcode-revert-02-301f794f3.patch b/tzcode-revert-02-301f794f3.patch new file mode 100644 index 0000000..b621070 --- /dev/null +++ b/tzcode-revert-02-301f794f3.patch @@ -0,0 +1,96 @@ +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. diff --git a/tzcode-revert-03-39fd078a6.patch b/tzcode-revert-03-39fd078a6.patch new file mode 100644 index 0000000..0cccaa2 --- /dev/null +++ b/tzcode-revert-03-39fd078a6.patch @@ -0,0 +1,319 @@ +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"), diff --git a/tzcode-symlink.patch b/tzcode-symlink.patch new file mode 100644 index 0000000..d13624f --- /dev/null +++ b/tzcode-symlink.patch @@ -0,0 +1,89 @@ +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; diff --git a/tzcode-zic.diff b/tzcode-zic.diff new file mode 100644 index 0000000..625cef2 --- /dev/null +++ b/tzcode-zic.diff @@ -0,0 +1,15 @@ +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) { diff --git a/tzcode2016f.tar.gz b/tzcode2016f.tar.gz new file mode 100644 index 0000000..6f5d849 --- /dev/null +++ b/tzcode2016f.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72325f384490a310eeb2ea0fab7e6f011a5be19adab2ff9d83bf9d1993b066ed +size 194905 diff --git a/tzcode2016f.tar.gz.asc b/tzcode2016f.tar.gz.asc new file mode 100644 index 0000000..65dd4b8 --- /dev/null +++ b/tzcode2016f.tar.gz.asc @@ -0,0 +1,11 @@ +-----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----- diff --git a/tzdata2016f.tar.gz b/tzdata2016f.tar.gz new file mode 100644 index 0000000..4d48ada --- /dev/null +++ b/tzdata2016f.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed8c951008d12f1db55a11e96fc055718c6571233327d9de16a7f8475e2502b0 +size 313286 diff --git a/tzdata2016f.tar.gz.asc b/tzdata2016f.tar.gz.asc new file mode 100644 index 0000000..1805a0e --- /dev/null +++ b/tzdata2016f.tar.gz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQEcBAABAgAGBQJXe8p1AAoJEAQ9tjdErUGMmc0H/i837mGKBIJLmS1xtr64uaT+ +LLLvI1gFTGJsqTaCya7aAVFlN/STM07otvYdkBDwQ6uIgjm8qAL33lGdi9IpTPp2 +YOj03QkWpyPRFtM1A9EcsVkKOfezGSiY7WQiOEk7R05lH1SRBlZ+eXVQl9fhadrj +qCRkcCasVIDQWMKCOhSch1HyUuR+Z1Ujomi7Z4d0AyQbMKhB1yGxYKCVGzN8KaOK +AFr0Dd44p72dqgPdC/V7G0xjTNOpuM1zt8SdJuOE2EASRraIvnnQctmKlbYI8l8L +ANvy9xl+p8VkuZi7yuSoqVSLYTQDE8pAMsfg0DZpAbnjV1G07FxekBMdNzdr5/E= +=7jGR +-----END PGP SIGNATURE----- From 6b65c89862e4e0046fbcd8fc4eaef7f2c5d3ffe8d5e8f2d62127259a7c6baf26 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Thu, 6 Oct 2016 13:37:08 +0000 Subject: [PATCH 3/7] restore OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=193 --- 0001-Positive-leap-second-on-2016-12-31.patch | 66 ---- tzcode-link.diff | 54 --- tzcode-revert-01-8c9cb9580.patch | 60 ---- tzcode-revert-02-301f794f3.patch | 96 ------ tzcode-revert-03-39fd078a6.patch | 319 ------------------ tzcode-symlink.patch | 89 ----- tzcode-zic.diff | 15 - tzcode2016f.tar.gz | 3 - tzcode2016f.tar.gz.asc | 11 - tzdata2016f.tar.gz | 3 - tzdata2016f.tar.gz.asc | 11 - 11 files changed, 727 deletions(-) delete mode 100644 0001-Positive-leap-second-on-2016-12-31.patch delete mode 100644 tzcode-link.diff delete mode 100644 tzcode-revert-01-8c9cb9580.patch delete mode 100644 tzcode-revert-02-301f794f3.patch delete mode 100644 tzcode-revert-03-39fd078a6.patch delete mode 100644 tzcode-symlink.patch delete mode 100644 tzcode-zic.diff delete mode 100644 tzcode2016f.tar.gz delete mode 100644 tzcode2016f.tar.gz.asc delete mode 100644 tzdata2016f.tar.gz delete mode 100644 tzdata2016f.tar.gz.asc diff --git a/0001-Positive-leap-second-on-2016-12-31.patch b/0001-Positive-leap-second-on-2016-12-31.patch deleted file mode 100644 index 1f60c2e..0000000 --- a/0001-Positive-leap-second-on-2016-12-31.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 6d5fc7fed0690f22574a9b795575e2bb7962716c Mon Sep 17 00:00:00 2001 -From: Tim Parenti -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 -. ---- - 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 - diff --git a/tzcode-link.diff b/tzcode-link.diff deleted file mode 100644 index e5ac3f2..0000000 --- a/tzcode-link.diff +++ /dev/null @@ -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; diff --git a/tzcode-revert-01-8c9cb9580.patch b/tzcode-revert-01-8c9cb9580.patch deleted file mode 100644 index 809499b..0000000 --- a/tzcode-revert-01-8c9cb9580.patch +++ /dev/null @@ -1,60 +0,0 @@ -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; diff --git a/tzcode-revert-02-301f794f3.patch b/tzcode-revert-02-301f794f3.patch deleted file mode 100644 index b621070..0000000 --- a/tzcode-revert-02-301f794f3.patch +++ /dev/null @@ -1,96 +0,0 @@ -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. diff --git a/tzcode-revert-03-39fd078a6.patch b/tzcode-revert-03-39fd078a6.patch deleted file mode 100644 index 0cccaa2..0000000 --- a/tzcode-revert-03-39fd078a6.patch +++ /dev/null @@ -1,319 +0,0 @@ -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"), diff --git a/tzcode-symlink.patch b/tzcode-symlink.patch deleted file mode 100644 index d13624f..0000000 --- a/tzcode-symlink.patch +++ /dev/null @@ -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; diff --git a/tzcode-zic.diff b/tzcode-zic.diff deleted file mode 100644 index 625cef2..0000000 --- a/tzcode-zic.diff +++ /dev/null @@ -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) { diff --git a/tzcode2016f.tar.gz b/tzcode2016f.tar.gz deleted file mode 100644 index 6f5d849..0000000 --- a/tzcode2016f.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72325f384490a310eeb2ea0fab7e6f011a5be19adab2ff9d83bf9d1993b066ed -size 194905 diff --git a/tzcode2016f.tar.gz.asc b/tzcode2016f.tar.gz.asc deleted file mode 100644 index 65dd4b8..0000000 --- a/tzcode2016f.tar.gz.asc +++ /dev/null @@ -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----- diff --git a/tzdata2016f.tar.gz b/tzdata2016f.tar.gz deleted file mode 100644 index 4d48ada..0000000 --- a/tzdata2016f.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ed8c951008d12f1db55a11e96fc055718c6571233327d9de16a7f8475e2502b0 -size 313286 diff --git a/tzdata2016f.tar.gz.asc b/tzdata2016f.tar.gz.asc deleted file mode 100644 index 1805a0e..0000000 --- a/tzdata2016f.tar.gz.asc +++ /dev/null @@ -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----- From 84303561579a6edc0d655ee5d0eb1de985169f9323ba7e0663a5915bde6c4738 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Thu, 6 Oct 2016 13:43:29 +0000 Subject: [PATCH 4/7] Accepting request 433595 from home:AndreasStieger:branches:Base:System bsc#1003324 OBS-URL: https://build.opensuse.org/request/show/433595 OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=194 --- timezone-java.changes | 13 ++----- timezone-java.spec | 2 + timezone.changes | 13 ++----- timezone.spec | 2 + tzcode-fromname.patch | 91 +++++++++++++++++++++++++++++++------------ 5 files changed, 79 insertions(+), 42 deletions(-) diff --git a/timezone-java.changes b/timezone-java.changes index aeceb8d..dc38305 100644 --- a/timezone-java.changes +++ b/timezone-java.changes @@ -1,10 +1,5 @@ ------------------------------------------------------------------- -Wed Sep 28 19:41:23 UTC 2016 - astieger@suse.com - -- use IANA released tarballs, verify signature - -------------------------------------------------------------------- -Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com +Thu Oct 6 13:38:20 UTC 2016 - astieger@suse.com - timezone update 2016g: * Turkey will remain on UTC+03 after 2016-10-30 bsc#997830 @@ -19,22 +14,22 @@ Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com + 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 + 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 + + tzcode-fromname.patch was updated to continue ensure correct + path exansion, preventing bsc#1003324 * 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 diff --git a/timezone-java.spec b/timezone-java.spec index ba45c0e..b12de80 100644 --- a/timezone-java.spec +++ b/timezone-java.spec @@ -35,6 +35,7 @@ Source4: %{name}.keyring Source5: %{name}.changes Patch0: tzdata-china.diff Patch3: iso3166-uk.diff +Patch4: tzcode-fromname.patch # COMMON-END # COMMON-END Url: http://www.gnu.org/software/libc/libc.html @@ -56,6 +57,7 @@ package is intended for Java Virtual Machine based on OpenJDK. # COMMON-PREP-BEGIN %patch0 -p1 %patch3 -p1 +%patch4 -p1 sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END # COMMON-PREP-END diff --git a/timezone.changes b/timezone.changes index aeceb8d..dc38305 100644 --- a/timezone.changes +++ b/timezone.changes @@ -1,10 +1,5 @@ ------------------------------------------------------------------- -Wed Sep 28 19:41:23 UTC 2016 - astieger@suse.com - -- use IANA released tarballs, verify signature - -------------------------------------------------------------------- -Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com +Thu Oct 6 13:38:20 UTC 2016 - astieger@suse.com - timezone update 2016g: * Turkey will remain on UTC+03 after 2016-10-30 bsc#997830 @@ -19,22 +14,22 @@ Fri Sep 16 12:08:42 UTC 2016 - astieger@suse.com + 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 + 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 + + tzcode-fromname.patch was updated to continue ensure correct + path exansion, preventing bsc#1003324 * 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 diff --git a/timezone.spec b/timezone.spec index 5d4a68b..8112f7c 100644 --- a/timezone.spec +++ b/timezone.spec @@ -33,6 +33,7 @@ Source4: %{name}.keyring Source5: %{name}.changes Patch0: tzdata-china.diff Patch3: iso3166-uk.diff +Patch4: tzcode-fromname.patch # COMMON-END BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -50,6 +51,7 @@ can select an appropriate time zone for your system with YaST. # COMMON-PREP-BEGIN %patch0 -p1 %patch3 -p1 +%patch4 -p1 sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END diff --git a/tzcode-fromname.patch b/tzcode-fromname.patch index f9d913d..31eddd5 100644 --- a/tzcode-fromname.patch +++ b/tzcode-fromname.patch @@ -1,27 +1,70 @@ -Index: timezone-2016b/zic.c +From: Andreas Stieger +Date: Thu, 06 Oct 2016 13:26:04 +0000 +References: bsc#845530 bsc#1003324 + +This patch ensures correct path expansion for the local time zone link. + +The 2016g release re-worked much of the code, however the problem +with broken symlinks remain. + +Brought up on mailing list: +http://mm.icann.org/pipermail/tz/2016-October/024280.html + +Index: timezone-2016g/zic.c =================================================================== ---- timezone-2016b.orig/zic.c -+++ timezone-2016b/zic.c -@@ -768,7 +768,7 @@ dolink(char const *fromfield, char const +--- timezone-2016g.orig/zic.c 2016-09-06 04:39:50.000000000 +0000 ++++ timezone-2016g/zic.c 2016-10-06 13:18:13.752297564 +0000 +@@ -764,12 +764,32 @@ namecheck(const char *name) + return componentcheck(name, component, cp); + } - 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)); ++static char * ++relname(char const *dir, char const *base) ++{ ++ if (*base == '/') ++ return ecpyalloc(base); ++ else { ++ size_t dir_len = strlen(dir); ++ bool needs_slash = dir_len && dir[dir_len - 1] != '/'; ++ char *result = emalloc(dir_len + needs_slash + strlen(base) + 1); ++ result[dir_len] = '/'; ++ strcpy(result + dir_len + needs_slash, base); ++ return memcpy(result, dir, dir_len); ++ } ++} ++ + static void + dolink(char const *fromfield, char const *tofield, bool staysymlink) + { + register int fromisdir; + bool todirs_made = false; + int link_errno; ++ register char * fromname; ++ register char * toname; ++ ++ fromname = relname(directory, fromfield); ++ toname = relname(directory, tofield); -- for (s = tofield + (t - fromfield); *s; s++) -+ for (s = tofield + (t - fromname); *s; s++) - dotdots += *s == '/'; - symlinkcontents - = emalloc(3 * dotdots + strlen(t) + 1); + /* + ** We get to be careful here since +@@ -800,7 +820,7 @@ dolink(char const *fromfield, char const + link_errno = link(fromfield, tofield) == 0 ? 0 : errno; + } + if (link_errno != 0) { +- const char *s = fromfield; ++ const char *s = fromname; + const char *t; + char *p; + size_t dotdots = 0; +@@ -810,9 +830,9 @@ dolink(char const *fromfield, char const + do + t = s; + while ((s = strchr(s, '/')) +- && strncmp(fromfield, tofield, ++s - fromfield) == 0); ++ && strncmp(fromname, tofield, ++s - fromname) == 0); + +- for (s = tofield + (t - fromfield); *s; s++) ++ for (s = tofield + (t - fromname); *s; s++) + dotdots += *s == '/'; + symlinkcontents = emalloc(3 * dotdots + strlen(t) + 1); + for (p = symlinkcontents; dotdots-- != 0; p += 3) From 2755a033ab5e7a5fda4fe4073c1382388e0f589e74bad9ea2c8e8183023ab60d Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Thu, 6 Oct 2016 13:48:03 +0000 Subject: [PATCH 5/7] clean diff OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=195 --- timezone.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timezone.spec b/timezone.spec index 8112f7c..7ba0254 100644 --- a/timezone.spec +++ b/timezone.spec @@ -32,8 +32,8 @@ Source3: https://www.iana.org/time-zones/repository/releases/tzcode%{vers Source4: %{name}.keyring Source5: %{name}.changes Patch0: tzdata-china.diff +Patch2: tzcode-fromname.patch Patch3: iso3166-uk.diff -Patch4: tzcode-fromname.patch # COMMON-END BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -50,8 +50,8 @@ can select an appropriate time zone for your system with YaST. %setup -q -c -a 1 # COMMON-PREP-BEGIN %patch0 -p1 +%patch2 -p1 %patch3 -p1 -%patch4 -p1 sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END From e642c2e332cf1e7561c329d24aacf2c5ac18418d08f9d49121833524c6bc2dc8 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Thu, 6 Oct 2016 13:48:21 +0000 Subject: [PATCH 6/7] clean diff OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=196 --- timezone-java.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timezone-java.spec b/timezone-java.spec index b12de80..be26b30 100644 --- a/timezone-java.spec +++ b/timezone-java.spec @@ -34,8 +34,8 @@ Source3: https://www.iana.org/time-zones/repository/releases/tzcode%{vers Source4: %{name}.keyring Source5: %{name}.changes Patch0: tzdata-china.diff +Patch2: tzcode-fromname.patch Patch3: iso3166-uk.diff -Patch4: tzcode-fromname.patch # COMMON-END # COMMON-END Url: http://www.gnu.org/software/libc/libc.html @@ -56,8 +56,8 @@ package is intended for Java Virtual Machine based on OpenJDK. # COMMON-PREP-BEGIN # COMMON-PREP-BEGIN %patch0 -p1 +%patch2 -p1 %patch3 -p1 -%patch4 -p1 sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END # COMMON-PREP-END From 0603a50597fde6a889af14bcaa81a7ae150d7289997c8d48d5b4c403446ac57b Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Thu, 6 Oct 2016 19:21:34 +0000 Subject: [PATCH 7/7] + Upstream changes did not account for TZDEFAULT being an absolute path. Prevent broken symlinks (bsc#1003324), add timezone-2016g-absolute-TZDEFAULT.patch tzcode-fromname.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/timezone?expand=0&rev=197 --- timezone-2016g-absolute-TZDEFAULT.patch | 107 ++++++++++++++++++++++++ timezone-java.changes | 8 +- timezone-java.spec | 4 +- timezone.changes | 8 +- timezone.spec | 4 +- tzcode-fromname.patch | 70 ---------------- 6 files changed, 121 insertions(+), 80 deletions(-) create mode 100644 timezone-2016g-absolute-TZDEFAULT.patch delete mode 100644 tzcode-fromname.patch diff --git a/timezone-2016g-absolute-TZDEFAULT.patch b/timezone-2016g-absolute-TZDEFAULT.patch new file mode 100644 index 0000000..3f808e8 --- /dev/null +++ b/timezone-2016g-absolute-TZDEFAULT.patch @@ -0,0 +1,107 @@ +From df9991a2186d4236ba1e97e6638fa53b578bc6d7 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Thu, 6 Oct 2016 11:47:17 -0700 +Subject: [PATCH] Do not assume TZDEFAULT is relative. + +Problem reported by Andreas Stieger in: +http://mm.icann.org/pipermail/tz/2016-October/024280.html +* NEWS: Document this. +* zic.c (relname): New function. +(dolink): Use it. +--- + zic.c | 65 ++++++++++++++++++++++++++++++++++++++++++++--------------------- + 1 file changed, 44 insertions(+), 21 deletions(-) + +--- + +Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1003324 + +diff --git a/zic.c b/zic.c +index 2505c11..eba223c 100644 +--- a/zic.c ++++ b/zic.c +@@ -764,6 +764,44 @@ namecheck(const char *name) + return componentcheck(name, component, cp); + } + ++/* Create symlink contents suitable for symlinking FROM to TO, as a ++ freshly allocated string. FROM should be a relative file name, and ++ is relative to the global variable DIRECTORY. TO can be either ++ relative or absolute. */ ++static char * ++relname(char const *from, char const *to) ++{ ++ size_t i, taillen, dotdotetcsize; ++ size_t dir_len = 0, dotdots = 0, linksize = SIZE_MAX; ++ char const *f = from; ++ char *result = NULL; ++ if (*to == '/') { ++ /* Make F absolute too. */ ++ size_t len = strlen(directory); ++ bool needslash = len && directory[len - 1] != '/'; ++ linksize = len + needslash + strlen(from) + 1; ++ f = result = emalloc(linksize); ++ strcpy(result, directory); ++ result[len] = '/'; ++ strcpy(result + len + needslash, from); ++ } ++ for (i = 0; f[i] && f[i] == to[i]; i++) ++ if (f[i] == '/') ++ dir_len = i + 1; ++ for (; f[i]; i++) ++ dotdots += f[i] == '/' && f[i - 1] != '/'; ++ taillen = i - dir_len; ++ dotdotetcsize = 3 * dotdots + taillen + 1; ++ if (dotdotetcsize <= linksize) { ++ if (!result) ++ result = emalloc(dotdotetcsize); ++ for (i = 0; i < dotdots; i++) ++ memcpy(result + 3 * i, "../", 3); ++ memmove(result + 3 * dotdots, f + dir_len, taillen + 1); ++ } ++ return result; ++} ++ + static void + dolink(char const *fromfield, char const *tofield, bool staysymlink) + { +@@ -800,30 +838,15 @@ dolink(char const *fromfield, char const *tofield, bool staysymlink) + link_errno = link(fromfield, tofield) == 0 ? 0 : errno; + } + if (link_errno != 0) { +- const char *s = fromfield; +- const char *t; +- char *p; +- size_t dotdots = 0; +- char *symlinkcontents; +- int symlink_errno; +- +- 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_errno = symlink(symlinkcontents, tofield) == 0 ? 0 : errno; ++ bool absolute = *fromfield == '/'; ++ char *linkalloc = absolute ? NULL : relname(fromfield, tofield); ++ char const *contents = absolute ? fromfield : linkalloc; ++ int symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno; + if (symlink_errno == ENOENT && !todirs_made) { + mkdirs(tofield, true); +- symlink_errno = symlink(symlinkcontents, tofield) == 0 ? 0 : errno; ++ symlink_errno = symlink(contents, tofield) == 0 ? 0 : errno; + } +- free(symlinkcontents); ++ free(linkalloc); + if (symlink_errno == 0) { + if (link_errno != ENOTSUP) + warning(_("symbolic link used because hard link failed: %s"), +-- +2.10.1 + diff --git a/timezone-java.changes b/timezone-java.changes index dc38305..12f2d3c 100644 --- a/timezone-java.changes +++ b/timezone-java.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Thu Oct 6 13:38:20 UTC 2016 - astieger@suse.com +Thu Oct 6 19:14:45 UTC 2016 - astieger@suse.com - timezone update 2016g: * Turkey will remain on UTC+03 after 2016-10-30 bsc#997830 @@ -26,8 +26,10 @@ Thu Oct 6 13:38:20 UTC 2016 - astieger@suse.com tzcode-revert-03-39fd078a6.patch tzcode-symlink.patch tzcode-zic.diff - + tzcode-fromname.patch was updated to continue ensure correct - path exansion, preventing bsc#1003324 + tzcode-fromname.patch + + Upstream changes did not account for TZDEFAULT being an + absolute path. Prevent broken symlinks (bsc#1003324), + add timezone-2016g-absolute-TZDEFAULT.patch * zdump has a new -i option to generate transitions in a more-compact but still human-readable format. (experimental) diff --git a/timezone-java.spec b/timezone-java.spec index be26b30..c602bb4 100644 --- a/timezone-java.spec +++ b/timezone-java.spec @@ -34,8 +34,8 @@ Source3: https://www.iana.org/time-zones/repository/releases/tzcode%{vers Source4: %{name}.keyring Source5: %{name}.changes Patch0: tzdata-china.diff -Patch2: tzcode-fromname.patch Patch3: iso3166-uk.diff +Patch4: timezone-2016g-absolute-TZDEFAULT.patch # COMMON-END # COMMON-END Url: http://www.gnu.org/software/libc/libc.html @@ -56,8 +56,8 @@ package is intended for Java Virtual Machine based on OpenJDK. # COMMON-PREP-BEGIN # COMMON-PREP-BEGIN %patch0 -p1 -%patch2 -p1 %patch3 -p1 +%patch4 -p1 sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END # COMMON-PREP-END diff --git a/timezone.changes b/timezone.changes index dc38305..12f2d3c 100644 --- a/timezone.changes +++ b/timezone.changes @@ -1,5 +1,5 @@ ------------------------------------------------------------------- -Thu Oct 6 13:38:20 UTC 2016 - astieger@suse.com +Thu Oct 6 19:14:45 UTC 2016 - astieger@suse.com - timezone update 2016g: * Turkey will remain on UTC+03 after 2016-10-30 bsc#997830 @@ -26,8 +26,10 @@ Thu Oct 6 13:38:20 UTC 2016 - astieger@suse.com tzcode-revert-03-39fd078a6.patch tzcode-symlink.patch tzcode-zic.diff - + tzcode-fromname.patch was updated to continue ensure correct - path exansion, preventing bsc#1003324 + tzcode-fromname.patch + + Upstream changes did not account for TZDEFAULT being an + absolute path. Prevent broken symlinks (bsc#1003324), + add timezone-2016g-absolute-TZDEFAULT.patch * zdump has a new -i option to generate transitions in a more-compact but still human-readable format. (experimental) diff --git a/timezone.spec b/timezone.spec index 7ba0254..6616e92 100644 --- a/timezone.spec +++ b/timezone.spec @@ -32,8 +32,8 @@ Source3: https://www.iana.org/time-zones/repository/releases/tzcode%{vers Source4: %{name}.keyring Source5: %{name}.changes Patch0: tzdata-china.diff -Patch2: tzcode-fromname.patch Patch3: iso3166-uk.diff +Patch4: timezone-2016g-absolute-TZDEFAULT.patch # COMMON-END BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -50,8 +50,8 @@ can select an appropriate time zone for your system with YaST. %setup -q -c -a 1 # COMMON-PREP-BEGIN %patch0 -p1 -%patch2 -p1 %patch3 -p1 +%patch4 -p1 sed -ri 's@/usr/local/etc/zoneinfo@%{_datadir}/zoneinfo@g' *.[1358] # COMMON-PREP-END diff --git a/tzcode-fromname.patch b/tzcode-fromname.patch deleted file mode 100644 index 31eddd5..0000000 --- a/tzcode-fromname.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Andreas Stieger -Date: Thu, 06 Oct 2016 13:26:04 +0000 -References: bsc#845530 bsc#1003324 - -This patch ensures correct path expansion for the local time zone link. - -The 2016g release re-worked much of the code, however the problem -with broken symlinks remain. - -Brought up on mailing list: -http://mm.icann.org/pipermail/tz/2016-October/024280.html - -Index: timezone-2016g/zic.c -=================================================================== ---- timezone-2016g.orig/zic.c 2016-09-06 04:39:50.000000000 +0000 -+++ timezone-2016g/zic.c 2016-10-06 13:18:13.752297564 +0000 -@@ -764,12 +764,32 @@ namecheck(const char *name) - return componentcheck(name, component, cp); - } - -+static char * -+relname(char const *dir, char const *base) -+{ -+ if (*base == '/') -+ return ecpyalloc(base); -+ else { -+ size_t dir_len = strlen(dir); -+ bool needs_slash = dir_len && dir[dir_len - 1] != '/'; -+ char *result = emalloc(dir_len + needs_slash + strlen(base) + 1); -+ result[dir_len] = '/'; -+ strcpy(result + dir_len + needs_slash, base); -+ return memcpy(result, dir, dir_len); -+ } -+} -+ - static void - dolink(char const *fromfield, char const *tofield, bool staysymlink) - { - register int fromisdir; - bool todirs_made = false; - int link_errno; -+ register char * fromname; -+ register char * toname; -+ -+ fromname = relname(directory, fromfield); -+ toname = relname(directory, tofield); - - /* - ** We get to be careful here since -@@ -800,7 +820,7 @@ dolink(char const *fromfield, char const - link_errno = link(fromfield, tofield) == 0 ? 0 : errno; - } - if (link_errno != 0) { -- const char *s = fromfield; -+ const char *s = fromname; - const char *t; - char *p; - size_t dotdots = 0; -@@ -810,9 +830,9 @@ dolink(char const *fromfield, char const - do - t = s; - while ((s = strchr(s, '/')) -- && strncmp(fromfield, tofield, ++s - fromfield) == 0); -+ && strncmp(fromname, tofield, ++s - fromname) == 0); - -- for (s = tofield + (t - fromfield); *s; s++) -+ for (s = tofield + (t - fromname); *s; s++) - dotdots += *s == '/'; - symlinkcontents = emalloc(3 * dotdots + strlen(t) + 1); - for (p = symlinkcontents; dotdots-- != 0; p += 3)