summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-12-21 10:05:37 +0100
committerRemi Collet <fedora@famillecollet.com>2016-12-21 10:05:37 +0100
commitcd03e963899c770aab3218b34d1274d7a0da3773 (patch)
tree72fca815446d1c31cde9ac21f55e9ed6731c7c1f
parent47a21c187b97f357da6e647850d76e647baa6b81 (diff)
php-pecl-redis: test build
-rw-r--r--php-pecl-redis.spec31
-rw-r--r--redis-pr1057.patch61
-rw-r--r--redis-pr1063.patch54
-rw-r--r--redis-pr1064.patch31
4 files changed, 8 insertions, 169 deletions
diff --git a/php-pecl-redis.spec b/php-pecl-redis.spec
index 13b5908..f2dccd7 100644
--- a/php-pecl-redis.spec
+++ b/php-pecl-redis.spec
@@ -18,7 +18,7 @@
%global pecl_name redis
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global with_tests 0%{?_with_tests:1}
+%global with_tests 1%{?_with_tests:1}
%global with_igbin 1
%if "%{php_version}" < "5.6"
# after igbinary
@@ -30,17 +30,13 @@
Summary: Extension for communicating with the Redis key-value store
Name: %{?sub_prefix}php-pecl-redis
-Version: 3.1.0
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Version: 3.1.1
+Release: 0%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/redis
-Patch0: %{pecl_name}-pr1057.patch
-Patch1: %{pecl_name}-pr1063.patch
-Patch2: %{pecl_name}-pr1064.patch
-
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
@@ -122,9 +118,6 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
-%patch0 -p1 -b .pr1057
-%patch1 -p1 -b .pr1063
-%patch2 -p1 -b .pr1064
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_REDIS_VERSION/{s/.* "//;s/".*$//;p}' php_redis.h)
@@ -240,17 +233,7 @@ cd NTS/tests
# Launch redis server
mkdir -p data
pidfile=$PWD/redis.pid
-# port number to allow 32/64 build at same time
-# and avoid conflict with a possible running server
-%if 0%{?__isa_bits}
-port=$(expr %{__isa_bits} + 6350)
-%else
-%ifarch x86_64
-port=6414
-%else
-port=6382
-%endif
-%endif
+port=$(%{__php} -r 'echo 9000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE;')
%{_root_bindir}/redis-server \
--bind 127.0.0.1 \
--port $port \
@@ -275,8 +258,7 @@ if [ -f $pidfile ]; then
%{_root_bindir}/redis-cli -p $port shutdown
fi
-exit $ret
-
+#exit $ret
%else
: Upstream test suite disabled
%endif
@@ -322,6 +304,9 @@ rm -rf %{buildroot}
%changelog
+* Wed Dec 21 2016 Remi Collet <remi@fedoraproject.org> - 3.1.1-0
+- test build for open upcoming 3.1.1
+
* Thu Dec 15 2016 Remi Collet <remi@fedoraproject.org> - 3.1.0-2
- test build for open upcoming 3.1.1
- open https://github.com/phpredis/phpredis/issues/1060 broken impl
diff --git a/redis-pr1057.patch b/redis-pr1057.patch
deleted file mode 100644
index 361cd9d..0000000
--- a/redis-pr1057.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 61c02e2985494b3de6ebbbd25f622085ca4b1103 Mon Sep 17 00:00:00 2001
-From: Pavlo Yatsukhnenko <yatsukhnenko@gmail.com>
-Date: Thu, 15 Dec 2016 15:08:17 +0200
-Subject: [PATCH] Fix segfault in testSerializerIGBinary
-
----
- library.c | 14 ++++++++------
- redis.c | 6 +++---
- 2 files changed, 11 insertions(+), 9 deletions(-)
-
-diff --git a/library.c b/library.c
-index a48fc41..4182d24 100644
---- a/library.c
-+++ b/library.c
-@@ -2087,14 +2087,16 @@ redis_unserialize(RedisSock* redis_sock, const char *val, int val_len,
- {
- /* This is most definitely not an igbinary string, so do
- not try to unserialize this as one. */
-- return 0;
-+ break;
- }
-
-- if(igbinary_unserialize((const uint8_t *)val, (size_t)val_len,
-- z_ret TSRMLS_CC) == 0
-- ) {
-- ret = 1;
-- }
-+#if (PHP_MAJOR_VERSION < 7)
-+ INIT_PZVAL(z_ret);
-+ ret = !igbinary_unserialize((const uint8_t *)val, (size_t)val_len, &z_ret TSRMLS_CC);
-+#else
-+ ret = !igbinary_unserialize((const uint8_t *)val, (size_t)val_len, z_ret TSRMLS_CC);
-+#endif
-+
- #endif
- break;
- }
-diff --git a/redis.c b/redis.c
-index 2b27b5f..25297d6 100644
---- a/redis.c
-+++ b/redis.c
-@@ -527,6 +527,9 @@ static void add_class_constants(zend_class_entry *ce, int is_cluster TSRMLS_DC)
- /* serializer */
- zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_NONE"), REDIS_SERIALIZER_NONE TSRMLS_CC);
- zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_PHP"), REDIS_SERIALIZER_PHP TSRMLS_CC);
-+#ifdef HAVE_REDIS_IGBINARY
-+ zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_IGBINARY"), REDIS_SERIALIZER_IGBINARY TSRMLS_CC);
-+#endif
-
- /* scan options*/
- zend_declare_class_constant_long(ce, ZEND_STRL("OPT_SCAN"), REDIS_OPT_SCAN TSRMLS_CC);
-@@ -541,9 +544,6 @@ static void add_class_constants(zend_class_entry *ce, int is_cluster TSRMLS_DC)
- zend_declare_class_constant_long(ce, ZEND_STRL("FAILOVER_DISTRIBUTE"), REDIS_FAILOVER_DISTRIBUTE TSRMLS_CC);
- zend_declare_class_constant_long(ce, ZEND_STRL("FAILOVER_DISTRIBUTE_SLAVES"), REDIS_FAILOVER_DISTRIBUTE_SLAVES TSRMLS_CC);
- }
--#ifdef HAVE_REDIS_IGBINARY
-- zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_IGBINARY"), REDIS_SERIALIZER_IGBINARY TSRMLS_CC);
--#endif
-
- zend_declare_class_constant_stringl(ce, "AFTER", 5, "after", 5 TSRMLS_CC);
- zend_declare_class_constant_stringl(ce, "BEFORE", 6, "before", 6 TSRMLS_CC);
diff --git a/redis-pr1063.patch b/redis-pr1063.patch
deleted file mode 100644
index 0c4d68d..0000000
--- a/redis-pr1063.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 18c7ab007649f068075880984e59938b849b5ab5 Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Fri, 16 Dec 2016 15:29:05 +0100
-Subject: [PATCH] fix #1062 restore 3.0.0 session behavior for PHP 7.1
-
----
- redis_session.c | 23 +++++++++++++++++------
- 1 file changed, 17 insertions(+), 6 deletions(-)
-
-diff --git a/redis_session.c b/redis_session.c
-index 6faae20..2ac2872 100644
---- a/redis_session.c
-+++ b/redis_session.c
-@@ -360,7 +360,7 @@ PS_READ_FUNC(redis)
- resp = redis_session_key(rpm, key->val, key->len, &resp_len);
- #endif
- cmd_len = redis_cmd_format_static(&cmd, "GET", "s", resp, resp_len);
--
-+
- efree(resp);
- if(redis_sock_write(redis_sock, cmd, cmd_len TSRMLS_CC) < 0) {
- efree(cmd);
-@@ -368,15 +368,26 @@ PS_READ_FUNC(redis)
- }
- efree(cmd);
-
-- /* read response */
-- if ((resp = redis_sock_read(redis_sock, &resp_len TSRMLS_CC)) == NULL) {
-+ /* Read response from Redis. If we get a NULL response from redis_sock_read
-+ * this can indicate an error, OR a "NULL bulk" reply (empty session data)
-+ * in which case we can reply with success. */
-+ if ((resp = redis_sock_read(redis_sock, &resp_len TSRMLS_CC)) == NULL && resp_len != -1) {
- return FAILURE;
- }
- #if (PHP_MAJOR_VERSION < 7)
-- *val = resp;
-- *vallen = resp_len;
-+ if (resp_len < 0) {
-+ *val = STR_EMPTY_ALLOC();
-+ *vallen = 0;
-+ } else {
-+ *val = resp;
-+ *vallen = resp_len;
-+ }
- #else
-- *val = zend_string_init(resp, resp_len, 0);
-+ if (resp_len < 0) {
-+ *val = ZSTR_EMPTY_ALLOC();
-+ } else {
-+ *val = zend_string_init(resp, resp_len, 0);
-+ }
- efree(resp);
- #endif
-
diff --git a/redis-pr1064.patch b/redis-pr1064.patch
deleted file mode 100644
index 3e43523..0000000
--- a/redis-pr1064.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 4706aae6eacc62e45cd4280dc5bd80668d22641c Mon Sep 17 00:00:00 2001
-From: Remi Collet <fedora@famillecollet.com>
-Date: Fri, 16 Dec 2016 15:31:11 +0100
-Subject: [PATCH] Fix #1060 don't return pointer to local volatile data
-
----
- library.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/library.h b/library.h
-index 8eb6708..6aef144 100644
---- a/library.h
-+++ b/library.h
-@@ -88,7 +88,7 @@ PHP_REDIS_API void redis_client_list_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSo
- #if ZEND_MODULE_API_NO >= 20100000
- #define REDIS_DOUBLE_TO_STRING(dbl_str, dbl) do { \
- char dbl_decsep = '.'; \
-- zend_string _zstr = {0}; \
-+ static zend_string _zstr = {0}; \
- _zstr.val = _php_math_number_format_ex(dbl, 16, &dbl_decsep, 1, NULL, 0); \
- _zstr.len = strlen(_zstr.val); \
- _zstr.gc = 0x10; \
-@@ -96,7 +96,7 @@ PHP_REDIS_API void redis_client_list_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSo
- } while (0);
- #else
- #define REDIS_DOUBLE_TO_STRING(dbl_str, dbl) do { \
-- zend_string _zstr = {0}; \
-+ static zend_string _zstr = {0}; \
- _zstr.val = _php_math_number_format(dbl, 16, '.', '\x00'); \
- _zstr.len = strlen(_zstr.val); \
- _zstr.gc = 0x10; \