[packages/php-pear-PEAR] check required php extensions early, before PEAR monstrocity gives uninformative errors
glen
glen at pld-linux.org
Wed May 14 18:27:38 CEST 2014
commit 4cf8a2f74892c75ceb847683157a88a3e9c114b6
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed May 14 19:26:32 2014 +0300
check required php extensions early, before PEAR monstrocity gives uninformative errors
ext-check.patch | 19 +++++++++++++++++++
php-pear-PEAR.spec | 8 +++++---
2 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/php-pear-PEAR.spec b/php-pear-PEAR.spec
index 5ee4188..f665ce7 100644
--- a/php-pear-PEAR.spec
+++ b/php-pear-PEAR.spec
@@ -12,7 +12,7 @@ Summary: PEAR Base System
Summary(pl.UTF-8): Podstawowy system PEAR
Name: php-pear-%{_pearname}
Version: 1.9.4
-Release: 4
+Release: 5
Epoch: 1
License: New BSD License
Group: Development/Languages/PHP
@@ -23,7 +23,8 @@ Source1: http://pear.php.net/get/Console_Getopt-1.2.3.tgz
Source2: http://pear.php.net/get/Structures_Graph-1.0.3.tgz
# Source2-md5: d2d8db74818be5cb0af7def3fc285bfc
Patch0: %{name}-sysconfdir.patch
-Patch5: %{name}-FHS.patch
+Patch1: ext-check.patch
+Patch2: %{name}-FHS.patch
URL: http://pear.php.net/package/PEAR
BuildRequires: /usr/bin/php
BuildRequires: php-pcre
@@ -118,7 +119,8 @@ oraz klasy dla PHP 5:
%pear_package_setup -z -D -n %{_pearname}-%{version}%{?_rc}
%patch0 -p1
-%{?with_FHS:%patch5 -p1}
+%patch1 -p1
+%{?with_FHS:%patch2 -p1}
find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
diff --git a/ext-check.patch b/ext-check.patch
new file mode 100644
index 0000000..440c847
--- /dev/null
+++ b/ext-check.patch
@@ -0,0 +1,19 @@
+--- PEAR-1.9.4/usr/share/pear/pearcmd.php~ 2014-05-14 19:21:49.000000000 +0300
++++ PEAR-1.9.4/usr/share/pear/pearcmd.php 2014-05-14 19:21:53.064418441 +0300
+@@ -45,6 +45,16 @@
+
+ $pear_package_version = "1.9.4";
+
++// before trying anything deep, ensure base extensions are present
++// this avoids debugging problems with bogus error messages, which really are
++// caused by missing extension
++foreach (array('pcre', 'zlib', 'xml2') as $ext) {
++ if (!extension_loaded($ext)) {
++ error_log("$argv[0] requires PHP extension $ext.");
++ exit(1);
++ }
++}
++
+ require_once 'PEAR.php';
+ require_once 'PEAR/Frontend.php';
+ require_once 'PEAR/Config.php';
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-pear-PEAR.git/commitdiff/4cf8a2f74892c75ceb847683157a88a3e9c114b6
More information about the pld-cvs-commit
mailing list