* Thu Jul 16 2009 Joe Orton <jorton@redhat.com> 5.3.0-4

- rediff systzdata patch
This commit is contained in:
jorton 2009-07-16 22:32:30 +00:00
parent 1890efc06e
commit 5f68886a63
2 changed files with 33 additions and 34 deletions

View File

@ -16,30 +16,8 @@ r1: initial revision
Index: ext/date/lib/timelib.m4 Index: ext/date/lib/timelib.m4
=================================================================== ===================================================================
--- ext/date/lib/timelib.m4 (revision 284069) --- php-5.3.0/ext/date/lib/parse_tz.c.systzdata
+++ ext/date/lib/timelib.m4 (working copy) +++ php-5.3.0/ext/date/lib/parse_tz.c
@@ -78,3 +78,17 @@
dnl Check for strtoll, atoll
AC_CHECK_FUNCS(strtoll atoll strftime)
+
+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
+[ --with-system-tzdata[=DIR] to specify use of system timezone data],
+no, no)
+
+if test "$PHP_SYSTEM_TZDATA" != "no"; then
+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
+
+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
+ [Define for location of system timezone data])
+ fi
+fi
+
Index: ext/date/lib/parse_tz.c
===================================================================
--- ext/date/lib/parse_tz.c (revision 284069)
+++ ext/date/lib/parse_tz.c (working copy)
@@ -20,6 +20,16 @@ @@ -20,6 +20,16 @@
#include "timelib.h" #include "timelib.h"
@ -57,7 +35,7 @@ Index: ext/date/lib/parse_tz.c
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_LOCALE_H #ifdef HAVE_LOCALE_H
@@ -31,8 +41,13 @@ @@ -31,7 +41,12 @@
#else #else
#include <strings.h> #include <strings.h>
#endif #endif
@ -65,12 +43,11 @@ Index: ext/date/lib/parse_tz.c
+#ifndef HAVE_SYSTEM_TZDATA +#ifndef HAVE_SYSTEM_TZDATA
#include "timezonedb.h" #include "timezonedb.h"
+#endif +#endif
+#include <ctype.h>
+ +
+#include <ctype.h>
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
# if defined(__LITTLE_ENDIAN__) # if defined(__LITTLE_ENDIAN__)
# undef WORDS_BIGENDIAN
@@ -51,9 +66,14 @@ @@ -51,9 +66,14 @@
static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz) static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
@ -89,7 +66,7 @@ Index: ext/date/lib/parse_tz.c
/* read BC flag */ /* read BC flag */
tz->bc = (**tzf == '\1'); tz->bc = (**tzf == '\1');
*tzf += 1; *tzf += 1;
@@ -253,8 +273,391 @@ @@ -253,7 +273,390 @@ void timelib_dump_tzinfo(timelib_tzinfo
} }
} }
@ -122,7 +99,7 @@ Index: ext/date/lib/parse_tz.c
+#define LOCINFO_HASH_SIZE (1021) +#define LOCINFO_HASH_SIZE (1021)
+ +
+static uint32_t tz_hash(const char *str) +static uint32_t tz_hash(const char *str)
{ +{
+ const unsigned char *p = (const unsigned char *)str; + const unsigned char *p = (const unsigned char *)str;
+ uint32_t hash = 5381; + uint32_t hash = 5381;
+ int c; + int c;
@ -478,11 +455,10 @@ Index: ext/date/lib/parse_tz.c
+#endif +#endif
+ +
+static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb) +static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
+{ {
int left = 0, right = tzdb->index_size - 1; int left = 0, right = tzdb->index_size - 1;
#ifdef HAVE_SETLOCALE #ifdef HAVE_SETLOCALE
char *cur_locale = NULL, *tmp; @@ -292,36 +695,124 @@ static int seek_to_tz_position(const uns
@@ -292,36 +695,124 @@
return 0; return 0;
} }
@ -610,3 +586,23 @@ Index: ext/date/lib/parse_tz.c
} else { } else {
tmp = NULL; tmp = NULL;
} }
--- php-5.3.0/ext/date/lib/timelib.m4.systzdata
+++ php-5.3.0/ext/date/lib/timelib.m4
@@ -78,3 +78,17 @@ stdlib.h
dnl Check for strtoll, atoll
AC_CHECK_FUNCS(strtoll atoll strftime)
+
+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
+[ --with-system-tzdata[=DIR] to specify use of system timezone data],
+no, no)
+
+if test "$PHP_SYSTEM_TZDATA" != "no"; then
+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
+
+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
+ [Define for location of system timezone data])
+ fi
+fi
+

View File

@ -13,7 +13,7 @@
Summary: PHP scripting language for creating dynamic web sites Summary: PHP scripting language for creating dynamic web sites
Name: php Name: php
Version: 5.3.0 Version: 5.3.0
Release: 3%{?dist} Release: 4%{?dist}
License: PHP License: PHP
Group: Development/Languages Group: Development/Languages
URL: http://www.php.net/ URL: http://www.php.net/
@ -843,6 +843,9 @@ rm files.* macros.php
%files enchant -f files.enchant %files enchant -f files.enchant
%changelog %changelog
* Thu Jul 16 2009 Joe Orton <jorton@redhat.com> 5.3.0-4
- rediff systzdata patch
* Thu Jul 16 2009 Joe Orton <jorton@redhat.com> 5.3.0-3 * Thu Jul 16 2009 Joe Orton <jorton@redhat.com> 5.3.0-3
- update to v6 of systzdata patch; various fixes - update to v6 of systzdata patch; various fixes