[packages/php-pecl-expect] More fixes; run test suite

arekm arekm at pld-linux.org
Thu Feb 19 15:19:35 CET 2026


commit 4740cf78327085ed9487d7853fe0b61bfc5ce3e7
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Feb 19 15:19:26 2026 +0100

    More fixes; run test suite

 build.patch          | 22 ++++++++++++++++++++++
 php-pecl-expect.spec | 11 +++++++++++
 2 files changed, 33 insertions(+)
---
diff --git a/php-pecl-expect.spec b/php-pecl-expect.spec
index ae13b6a..0cd4bc5 100644
--- a/php-pecl-expect.spec
+++ b/php-pecl-expect.spec
@@ -1,3 +1,5 @@
+%bcond_without	tests
+
 %define		php_name	php%{?php_suffix}
 %define		modname	expect
 %define		status		beta
@@ -16,6 +18,9 @@ URL:		https://pecl.php.net/package/expect/
 BuildRequires:	%{php_name}-devel >= 3:5.0.4
 BuildRequires:	expect-devel
 BuildRequires:	rpmbuild(macros) >= 1.650
+%if %{with tests}
+BuildRequires:	%{php_name}-cgi
+%endif
 %{?requires_php_extension}
 Provides:	php(%{modname}) = %{version}
 Obsoletes:	php-pecl-expect < 0.3.1-5
@@ -45,6 +50,12 @@ phpize
 	--with-tcldir=%{_prefix}/lib
 %{__make}
 
+%if %{with tests}
+export NO_INTERACTION=1
+%{__make} test \
+	PHP_EXECUTABLE=%{_bindir}/%{php_name}.cgi
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
diff --git a/build.patch b/build.patch
index a31fb70..032c180 100644
--- a/build.patch
+++ b/build.patch
@@ -15,3 +15,25 @@
  	
  	if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3) { WRONG_PARAM_COUNT; }
  
+--- php73-pecl-expect-0.4.0/expect.c~	2026-02-19 13:50:13.000000000 +0100
++++ php73-pecl-expect-0.4.0/expect.c	2026-02-19 13:53:50.294628963 +0100
+@@ -453,11 +453,15 @@ PHP_FUNCTION(expect_expectl)
+ 		if (z_match && exp_match && exp_match_len > 0) {
+ 			char *tmp = (char *)emalloc (sizeof(char) * (exp_match_len + 1));
+ 			strlcpy (tmp, exp_match, exp_match_len + 1);
+-#if PHP_MAJOR_VERSION >= 7
++#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 4)
+             z_match = zend_try_array_init(z_match);
+-			if (!z_match) {
+-				return;
+-			}
++            if (!z_match) {
++                return;
++            }
++            add_index_string(z_match, 0, tmp);
++#elif PHP_MAJOR_VERSION >= 7
++            zval_dtor(z_match);
++            array_init(z_match);
+             add_index_string(z_match, 0, tmp);
+ #else
+ 			zval_dtor (z_match);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-pecl-expect.git/commitdiff/4740cf78327085ed9487d7853fe0b61bfc5ce3e7



More information about the pld-cvs-commit mailing list