[php-pear-Validate] upstream approved patches

Remi Collet remi at fedoraproject.org
Sat Oct 16 06:48:43 UTC 2010


commit 4f75deb92003e84f2f9c12200f57ed58468d3d87
Author: remi <fedora at famillecollet.com>
Date:   Sat Oct 16 08:48:31 2010 +0200

    upstream approved patches

 php-pear-Validate.patch |   41 +++++++++++++++++++++++++++++++++++++++++
 php-pear-Validate.spec  |   24 +++++++++++++++++++++++-
 2 files changed, 64 insertions(+), 1 deletions(-)
---
diff --git a/php-pear-Validate.patch b/php-pear-Validate.patch
new file mode 100644
index 0000000..ac8dc31
--- /dev/null
+++ b/php-pear-Validate.patch
@@ -0,0 +1,41 @@
+diff -up Validate-0.8.4/php-pear-Validate.xml.orig Validate-0.8.4/php-pear-Validate.xml
+--- Validate-0.8.4/php-pear-Validate.xml.orig	2010-10-16 08:34:10.000000000 +0200
++++ Validate-0.8.4/php-pear-Validate.xml	2010-10-16 08:34:15.000000000 +0200
+@@ -77,10 +77,10 @@ Bug #17756 Avoiding ereg
+    <file md5sum="cf8996b7907ec50324effadec1bbae3c" name="tests/multicard.phpt" role="test" />
+    <file md5sum="e296b32a00f909bfbb4ffc1ec483396b" name="tests/multiple.phpt" role="test" />
+    <file md5sum="1c7f996303ba665961aed645127e7886" name="tests/number.phpt" role="test" />
+-   <file md5sum="b600917e25b9c052efaba9659bf01d4b" name="tests/testdate.phpt" role="test" />
++   <file md5sum="ccc40b0508d88de566caa26265026e0c" name="tests/testdate.phpt" role="test" />
+    <file md5sum="0499ff097b6913432bc421f864996dd7" name="tests/uri.phpt" role="test" />
+    <file md5sum="f8790e48b597dff12a643e08e9be3fab" name="LICENSE" role="doc" />
+-   <file md5sum="169d6497891a1a8e7c891b9809c0d2d9" name="Validate.php" role="php" />
++   <file md5sum="5589d2d21a2bc161fa0e9f1a00630a20" name="Validate.php" role="php" />
+   </dir>
+  </contents>
+  <dependencies>
+diff -up Validate-0.8.4/tests/testdate.phpt.orig Validate-0.8.4/tests/testdate.phpt
+--- Validate-0.8.4/tests/testdate.phpt.orig	2010-10-10 15:42:09.000000000 +0200
++++ Validate-0.8.4/tests/testdate.phpt	2010-10-16 08:32:29.000000000 +0200
+@@ -1,5 +1,7 @@
+ --TEST--
+ testdate.phpt: Unit tests for 'Validate.php'
++--INI--
++date.timezone=UTC
+ --FILE--
+ <?php
+ // $Id: testdate.phpt 236794 2007-06-01 07:44:55Z amir $
+diff -up Validate-0.8.4/Validate.php.orig Validate-0.8.4/Validate.php
+--- Validate-0.8.4/Validate.php.orig	2010-10-16 08:32:19.000000000 +0200
++++ Validate-0.8.4/Validate.php	2010-10-16 08:32:46.000000000 +0200
+@@ -1093,7 +1093,9 @@ class Validate
+                 $class        = implode('_', $validateType);
+                 $classPath    = str_replace('_', DIRECTORY_SEPARATOR, $class);
+                 $class        = 'Validate_' . $class;
+-                if (!Validate::_includePathFileExists("Validate/$classPath.php")) {
++                if (Validate::_includePathFileExists("Validate/$classPath.php")) {
++                    include_once "Validate/$classPath.php";
++                } else {
+                     trigger_error("$class isn't installed or you may have some permission issues", E_USER_ERROR);
+                 }
+ 
diff --git a/php-pear-Validate.spec b/php-pear-Validate.spec
index 8c8c9fa..a844788 100644
--- a/php-pear-Validate.spec
+++ b/php-pear-Validate.spec
@@ -3,7 +3,7 @@
 
 Name:           php-pear-Validate
 Version:        0.8.4
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Validation Class for Various Data Types
 
 Group:          Development/Libraries
@@ -12,9 +12,14 @@ URL:            http://pear.php.net/package/Validate
 Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
 Source2:        xml2changelog
 
+Patch0:         %{name}.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 BuildRequires:  php-pear >= 1:1.4.9-1.2
+# for test suite
+BuildRequires:  php-pear(Validate_Finance_CreditCard) php-pear(Date)
+
 
 Requires:       php-pear(PEAR)
 Requires:       php-pear(Date)
@@ -45,6 +50,8 @@ cd %{pear_name}-%{version}
 # package.xml is V2
 mv ../package.xml %{name}.xml
 
+%patch0 -p1
+
 
 %build
 cd %{pear_name}-%{version}
@@ -68,6 +75,16 @@ install -d $RPM_BUILD_ROOT%{pear_xmldir}
 install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
 
 
+%check
+cd %{pear_name}-%{version}
+PHPRC=../php.ini %{__pear} \
+   run-tests \
+   -i "-d include_path=%{buildroot}%{pear_phpdir}:%{pear_phpdir}" \
+   tests | tee ../tests.log
+# pear doesn't set return code
+grep "6 PASSED TESTS" ../tests.log
+
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -92,6 +109,11 @@ fi
 
 
 %changelog
+* Sat Oct 16 2010 Remi Collet <Fedora at FamilleCollet.com> - 0.8.4-2
+- upstream approved patches for  https://pear.php.net/bugs/17947
+  and https://pear.php.net/bugs/17948
+- run test suite during %%check
+
 * Mon Oct 11 2010 Remi Collet <Fedora at FamilleCollet.com> - 0.8.4-1
 - Version 0.8.4 (beta) - API 0.7.0 (beta) - QA release
 - add generated Changelog


More information about the scm-commits mailing list