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
This commit is contained in:
Andreas Stieger 2016-10-06 13:43:29 +00:00 committed by Git OBS Bridge
parent 6b65c89862
commit 8430356157
5 changed files with 79 additions and 42 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,27 +1,70 @@
Index: timezone-2016b/zic.c
From: Andreas Stieger <astieger@suse.com>
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)