From 852388e03888fafa383aaede9c8c564a6189344b Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Wed, 14 Feb 2018 12:52:37 -0500 Subject: [PATCH] dev-php/PEAR-Validate: Revbump for EAPI, eclass changes and add tests Package-Manager: Portage-2.3.24, Repoman-2.3.6 --- .../PEAR-Validate-0.8.5-r1.ebuild | 22 +++++++++++++++++++ .../files/0.8.5-fix-test-php7.patch | 19 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 dev-php/PEAR-Validate/PEAR-Validate-0.8.5-r1.ebuild create mode 100644 dev-php/PEAR-Validate/files/0.8.5-fix-test-php7.patch diff --git a/dev-php/PEAR-Validate/PEAR-Validate-0.8.5-r1.ebuild b/dev-php/PEAR-Validate/PEAR-Validate-0.8.5-r1.ebuild new file mode 100644 index 000000000000..e8e5e342cc58 --- /dev/null +++ b/dev-php/PEAR-Validate/PEAR-Validate-0.8.5-r1.ebuild @@ -0,0 +1,22 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit php-pear-r2 + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" + +DESCRIPTION="Validation class" +LICENSE="BSD" +SLOT="0" +IUSE="minimal test" + +DEPEND="test? ( dev-php/PEAR-PEAR dev-php/PEAR-Date )" +RDEPEND="!minimal? ( dev-php/PEAR-Date )" +PATCHES=( "${FILESDIR}/0.8.5-fix-test-php7.patch" ) +HTML_DOCS=( docs/Example_Locale.php docs/sample_multiple.php ) + +src_test() { + peardev run-tests tests || die +} diff --git a/dev-php/PEAR-Validate/files/0.8.5-fix-test-php7.patch b/dev-php/PEAR-Validate/files/0.8.5-fix-test-php7.patch new file mode 100644 index 000000000000..069c5467d049 --- /dev/null +++ b/dev-php/PEAR-Validate/files/0.8.5-fix-test-php7.patch @@ -0,0 +1,19 @@ +From a22b5cf2c7e4b4cf366c311150721961d9b456ea Mon Sep 17 00:00:00 2001 +From: Christian Weiske +Date: Thu, 16 Jul 2015 00:38:55 +0200 +Subject: [PATCH] Make tests run on PHP 7 + +diff --git a/Validate.php b/Validate.php +index a8f621c..ea6cfa7 100644 +--- a/Validate.php ++++ b/Validate.php +@@ -583,7 +583,8 @@ function email($email, $options = null) + if ($use_rfc822? Validate::__emailRFC822($email, $options) : + preg_match($regex, $email)) { + if ($check_domain && function_exists('checkdnsrr')) { +- $domain = preg_replace('/[^-a-z.0-9]/i', '', array_pop(explode('@', $email))); ++ $parts = explode('@', $email); ++ $domain = preg_replace('/[^-a-z.0-9]/i', '', array_pop($parts)); + if (checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A')) { + return true; + } -- 2.26.2