summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-11-02 08:28:06 +0100
committerRemi Collet <fedora@famillecollet.com>2014-11-02 08:28:06 +0100
commitb174686154d592f823a74d4106d0f4ce053779ab (patch)
treecdaff52a16b84f5b6e1fa385f8001d364b05cf7e
parent38cac6e7b873c4ad6e57be66372b06d7683b5a70 (diff)
php54-php:
- new version of systzdata patch, fix case sensitivity - add php54-cgi command in base system
-rw-r--r--php-5.3.34-systzdata-v11.patch (renamed from php-5.3.1-systzdata-v10.patch)48
-rw-r--r--php.spec10
2 files changed, 42 insertions, 16 deletions
diff --git a/php-5.3.1-systzdata-v10.patch b/php-5.3.34-systzdata-v11.patch
index b262fae..bfca49b 100644
--- a/php-5.3.1-systzdata-v10.patch
+++ b/php-5.3.34-systzdata-v11.patch
@@ -2,7 +2,9 @@ Add support for use of the system timezone database, rather
than embedding a copy. Discussed upstream but was not desired.
History:
-r10 : make timezone case insensitive
+r11: use canonical names to avoid more case sensitivity issues
+ round lat/long from zone.tab towards zero per builtin db
+r10: make timezone case insensitive
r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
r8: fix compile error without --with-system-tzdata configured
r7: improve check for valid timezone id to exclude directories
@@ -17,6 +19,8 @@ r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
r2: add filesystem trawl to set up name alias index
r1: initial revision
+diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
+index 5d2aec9..671b398 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -20,6 +20,16 @@
@@ -67,7 +71,7 @@ r1: initial revision
/* read BC flag */
tz->bc = (**tzf == '\1');
*tzf += 1;
-@@ -256,7 +276,405 @@
+@@ -256,7 +276,418 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
@@ -165,7 +169,7 @@ r1: initial revision
+ /* Round to five decimal place, not because it's a good idea,
+ * but, because the builtin data uses rounded data, so, match
+ * that. */
-+ *result = round(v * sign * 100000.0) / 100000.0;
++ *result = trunc(v * sign * 100000.0) / 100000.0;
+
+ return p;
+}
@@ -293,7 +297,7 @@ r1: initial revision
+{
+ const timelib_tzdb_index_entry *alpha = first, *beta = second;
+
-+ return strcmp(alpha->id, beta->id);
++ return strcasecmp(alpha->id, beta->id);
+}
+
+
@@ -431,6 +435,26 @@ r1: initial revision
+ return S_ISREG(st->st_mode) && st->st_size > 20;
+}
+
++/* To allow timezone names to be used case-insensitively, find the
++ * canonical name for this timezone, if possible. */
++static const char *canonical_tzname(const char *timezone)
++{
++ if (timezonedb_system) {
++ timelib_tzdb_index_entry *ent, lookup;
++
++ lookup.id = (char *)timezone;
++
++ ent = bsearch(&lookup, timezonedb_system->index,
++ timezonedb_system->index_size, sizeof lookup,
++ sysdbcmp);
++ if (ent) {
++ return ent->id;
++ }
++ }
++
++ return timezone;
++}
++
+/* Return the mmap()ed tzfile if found, else NULL. On success, the
+ * length of the mapped data is placed in *length. */
+static char *map_tzfile(const char *timezone, size_t *length)
@@ -444,14 +468,7 @@ r1: initial revision
+ return NULL;
+ }
+
-+ if (system_location_table) {
-+ const struct location_info *li;
-+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
-+ /* Use the stored name to avoid case issue */
-+ timezone = li->name;
-+ }
-+ }
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
+
+ fd = open(fname, O_RDONLY);
+ if (fd == -1) {
@@ -474,7 +491,7 @@ r1: initial revision
{
int left = 0, right = tzdb->index_size - 1;
#ifdef HAVE_SETLOCALE
-@@ -295,36 +713,135 @@
+@@ -295,36 +726,135 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
return 0;
}
@@ -556,7 +573,7 @@ r1: initial revision
+ }
+ }
+
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
+
+ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
+ }
@@ -613,6 +630,8 @@ r1: initial revision
} else {
tmp = NULL;
}
+diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
+index c725572..4c837c7 100644
--- a/ext/date/lib/timelib.m4
+++ b/ext/date/lib/timelib.m4
@@ -78,3 +78,17 @@ stdlib.h
@@ -633,3 +652,4 @@ r1: initial revision
+ fi
+fi
+
+
diff --git a/php.spec b/php.spec
index b900b31..50a7c64 100644
--- a/php.spec
+++ b/php.spec
@@ -106,7 +106,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: %{?scl_prefix}php
Version: 5.4.34
-Release: 1%{?dist}
+Release: 2%{?dist}
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
@@ -139,7 +139,7 @@ Patch21: php-5.4.7-odbctimer.patch
# Functional changes
Patch40: php-5.4.0-dlopen.patch
Patch41: php-5.4.0-easter.patch
-Patch42: php-5.3.1-systzdata-v10.patch
+Patch42: php-5.3.34-systzdata-v11.patch
# See http://bugs.php.net/53436
Patch43: php-5.4.0-phpize.patch
# Use -lldap_r for OpenLDAP
@@ -1204,6 +1204,7 @@ install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/php-fpm
%if 0%{?scl:1}
install -m 755 -d $RPM_BUILD_ROOT%{_root_bindir}
ln -s %{_bindir}/php $RPM_BUILD_ROOT%{_root_bindir}/%{scl}
+ln -s %{_bindir}/php-cgi $RPM_BUILD_ROOT%{_root_bindir}/%{scl}-cgi
ln -s %{_bindir}/phar.phar $RPM_BUILD_ROOT%{_root_bindir}/%{scl_prefix}phar
%if %{with_lsws}
ln -s %{_bindir}/lsphp $RPM_BUILD_ROOT%{_root_bindir}/ls%{scl}
@@ -1438,6 +1439,7 @@ fi
%doc sapi/cgi/README* sapi/cli/README
%if 0%{?scl:1}
%{_root_bindir}/%{scl}
+%{_root_bindir}/%{scl}-cgi
%{_root_bindir}/%{scl_prefix}phar
%endif
@@ -1538,6 +1540,10 @@ fi
%changelog
+* Sun Nov 2 2014 Remi Collet <remi@fedoraproject.org> 5.4.34-2
+- new version of systzdata patch, fix case sensitivity
+- add php54-cgi command in base system
+
* Thu Oct 16 2014 Remi Collet <remi@fedoraproject.org> 5.4.34-1
- Update to 5.4.34
http://www.php.net/releases/5_4_34.php