commit:     2817239c931f3f90a80a6a9d215c3ac5490a0a6f
Author:     Kent Fredric <kentfredric <AT> gmail <DOT> com>
AuthorDate: Fri Mar  4 23:41:11 2016 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Mar  5 20:32:32 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2817239c

dev-perl/Net-SSLeay: Fix tests re: Networking

1. Reduce clutter for people who aren't running tests, or
aren't running tests with DIST_OVERRIDE=~/network/

2. Enable network-tests if DIST_OVERRIDE=~/network/

Package-Manager: portage-2.2.27

 dev-perl/Net-SSLeay/Net-SSLeay-1.720.0.ebuild        | 10 ++++++++++
 .../Net-SSLeay/files/1.72-config-nettest-no.patch    | 20 ++++++++++++++++++++
 .../Net-SSLeay/files/1.72-config-nettest-yes.patch   | 20 ++++++++++++++++++++
 3 files changed, 50 insertions(+)

diff --git a/dev-perl/Net-SSLeay/Net-SSLeay-1.720.0.ebuild 
b/dev-perl/Net-SSLeay/Net-SSLeay-1.720.0.ebuild
index fb93cb8..0c76338 100644
--- a/dev-perl/Net-SSLeay/Net-SSLeay-1.720.0.ebuild
+++ b/dev-perl/Net-SSLeay/Net-SSLeay-1.720.0.ebuild
@@ -39,9 +39,19 @@ src_prepare() {
                -e "/\$opts->{optimize} = '-O2 -g';/d" \
                -e "s,\"\$prefix/lib\",\"\$prefix/$(get_libdir)\"," \
                inc/Module/Install/PRIVATE/Net/SSLeay.pm || die
+
+       local my_test_control
+       my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
+
        if use test; then
                perl_rm_files 't/local/01_pod.t' 't/local/02_pod_coverage.t' 
't/local/kwalitee.t'
        fi
+       if use test && has network ${my_test_control} ; then
+               eapply "${FILESDIR}/${DIST_VERSION}-config-nettest-yes.patch"
+       else
+               eapply "${FILESDIR}/${DIST_VERSION}-config-nettest-no.patch"
+       fi
+
        perl-module_src_prepare
 }
 src_install() {

diff --git a/dev-perl/Net-SSLeay/files/1.72-config-nettest-no.patch 
b/dev-perl/Net-SSLeay/files/1.72-config-nettest-no.patch
new file mode 100644
index 0000000..0090bfd
--- /dev/null
+++ b/dev-perl/Net-SSLeay/files/1.72-config-nettest-no.patch
@@ -0,0 +1,20 @@
+diff -Naur Net-SSLeay-1.72/inc/Module/Install/PRIVATE/Net/SSLeay.pm 
Net-SSLeay-1.72b/inc/Module/Install/PRIVATE/Net/SSLeay.pm
+--- Net-SSLeay-1.72/inc/Module/Install/PRIVATE/Net/SSLeay.pm   2015-08-02 
05:54:14.000000000 +0000
++++ Net-SSLeay-1.72b/inc/Module/Install/PRIVATE/Net/SSLeay.pm  2016-03-04 
23:29:36.997983312 +0000
+@@ -47,15 +47,7 @@
+         LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} 
@{$opts->{lib_links}})),
+     );
+ 
+-    if ( $self->prompt(
+-            "Do you want to run external tests?\n".
+-            "These tests *will* *fail* if you do not have network 
connectivity.",
+-            'n',
+-    ) =~ /^y/i ) {
+-        $self->tests('t/*/*.t t/*/*/*.t');
+-    } else {
+-        $self->tests('t/local/*.t t/handle/local/*.t');
+-    }
++    $self->tests('t/local/*.t t/handle/local/*.t');
+ }
+ 
+ sub ssleay_get_build_opts {

diff --git a/dev-perl/Net-SSLeay/files/1.72-config-nettest-yes.patch 
b/dev-perl/Net-SSLeay/files/1.72-config-nettest-yes.patch
new file mode 100644
index 0000000..d796625
--- /dev/null
+++ b/dev-perl/Net-SSLeay/files/1.72-config-nettest-yes.patch
@@ -0,0 +1,20 @@
+diff -Naur Net-SSLeay-1.72/inc/Module/Install/PRIVATE/Net/SSLeay.pm 
Net-SSLeay-1.72b/inc/Module/Install/PRIVATE/Net/SSLeay.pm
+--- Net-SSLeay-1.72/inc/Module/Install/PRIVATE/Net/SSLeay.pm   2015-08-02 
05:54:14.000000000 +0000
++++ Net-SSLeay-1.72b/inc/Module/Install/PRIVATE/Net/SSLeay.pm  2016-03-04 
23:28:49.543069218 +0000
+@@ -47,15 +47,7 @@
+         LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} 
@{$opts->{lib_links}})),
+     );
+ 
+-    if ( $self->prompt(
+-            "Do you want to run external tests?\n".
+-            "These tests *will* *fail* if you do not have network 
connectivity.",
+-            'n',
+-    ) =~ /^y/i ) {
+-        $self->tests('t/*/*.t t/*/*/*.t');
+-    } else {
+-        $self->tests('t/local/*.t t/handle/local/*.t');
+-    }
++    $self->tests('t/*/*.t t/*/*/*.t');
+ }
+ 
+ sub ssleay_get_build_opts {

Reply via email to