summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-09-12 15:45:34 +0200
committerRemi Collet <remi@php.net>2022-09-12 15:45:34 +0200
commitb836fa9ed0a7e4957268e029fcb7826a68e6718d (patch)
tree82057f2a5a957a779d5d490bec3d0a8001e0c86c
parente98f47093023a5e670c92dc41bcbe662af1f833c (diff)
add upstream patch for test suite with PHP 8.2
-rw-r--r--dbase-tests.patch35
-rw-r--r--php-pecl-dbase.spec34
2 files changed, 44 insertions, 25 deletions
diff --git a/dbase-tests.patch b/dbase-tests.patch
new file mode 100644
index 0000000..7d2f09f
--- /dev/null
+++ b/dbase-tests.patch
@@ -0,0 +1,35 @@
+From d7dce1639a9d989a498c967d8e716c7cbb918a05 Mon Sep 17 00:00:00 2001
+From: "Christoph M. Becker" <cmbecker69@gmx.de>
+Date: Thu, 23 Jun 2022 00:16:37 +0200
+Subject: [PATCH] Ensure the clean section won't bork
+
+If the file already has been deleted, or never have been created in the
+first place, `unlink()` would throw a warning, and the test case might
+be marked as borked. We silence the call to avoid that.
+---
+ tests/002.phpt | 2 +-
+ tests/dbase_create_error_8.phpt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/002.phpt b/tests/002.phpt
+index 30ac6bb..759957a 100644
+--- a/tests/002.phpt
++++ b/tests/002.phpt
+@@ -56,5 +56,5 @@ Done
+ <?php
+ $file = dirname(__FILE__)."/002.dbf";
+
+-unlink($file);
++@unlink($file);
+ ?>
+diff --git a/tests/dbase_create_error_8.phpt b/tests/dbase_create_error_8.phpt
+index e2a0b4c..5d6e3bd 100644
+--- a/tests/dbase_create_error_8.phpt
++++ b/tests/dbase_create_error_8.phpt
+@@ -148,5 +148,5 @@ bool(false)
+ <?php
+ define('FILENAME', __DIR__ . DIRECTORY_SEPARATOR . 'dbase_create_error.dbf');
+
+-unlink(FILENAME);
++@unlink(FILENAME);
+ ?>
diff --git a/php-pecl-dbase.spec b/php-pecl-dbase.spec
index 7aca4fe..27515b7 100644
--- a/php-pecl-dbase.spec
+++ b/php-pecl-dbase.spec
@@ -13,7 +13,6 @@
%undefine _strict_symbol_defs_build
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
%scl_package php-pecl-dbase
%endif
@@ -25,13 +24,15 @@
#global upstream_prever RC2
Summary: dBase database file access functions
-Name: %{?sub_prefix}php-pecl-dbase
+Name: %{?scl_prefix}php-pecl-dbase
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Patch0: %{pecl_name}-tests.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -45,28 +46,6 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
%description
@@ -95,6 +74,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1
+
chmod -x *.c *.h
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_DBASE_VERSION/{s/.* "//;s/".*$//;p}' php_dbase.h)
@@ -225,6 +206,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 12 2022 Remi Collet <remi@remirepo.net> - 7.1.1-2
+- add upstream patch for test suite with PHP 8.2
+
* Sat Oct 30 2021 Remi Collet <remi@remirepo.net> - 7.1.1-1
- update to 7.1.1