summaryrefslogtreecommitdiff
path: root/dev-perl/Feed-Find/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /dev-perl/Feed-Find/files
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'dev-perl/Feed-Find/files')
-rw-r--r--dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch109
-rw-r--r--dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch21
2 files changed, 130 insertions, 0 deletions
diff --git a/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch b/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch
new file mode 100644
index 000000000000..4cf8f567547a
--- /dev/null
+++ b/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch
@@ -0,0 +1,109 @@
+From bea092aae37300053b971a12b6e37b6104df41f9 Mon Sep 17 00:00:00 2001
+From: Nikolay Mishin <mi@ya.ru>
+Date: Thu, 22 Oct 2015 02:59:04 +0400
+Subject: Rework 01-find.t
+
+Rework test to not rely on external web resources by mocking the setup
+with a HTTP::Server::Simple derived webserver
+
+Bug: https://github.com/btrott/Feed-Find/pull/2
+Signed-off-by: Gary Greene <greeneg@tolharadys.net>
+Signed-off-by: Kent Fredric <kentnl@gentoo.org>
+---
+ t/01-find.t | 57 ++++++++++++++++++++++++++++++++------
+ t/htdocs/anchors-only.html | 9 ++++++
+ 2 files changed, 58 insertions(+), 8 deletions(-)
+ create mode 100644 t/htdocs/anchors-only.html
+
+diff --git a/t/01-find.t b/t/01-find.t
+index 58549b5..22d0048 100644
+--- a/t/01-find.t
++++ b/t/01-find.t
+@@ -1,20 +1,61 @@
++use CGI::Application::Server;
++use Test::HTTP::Server::Simple;
++
++package My::WebServer {
++ use base qw/Test::HTTP::Server::Simple CGI::Application::Server/;
++}
++
++package main;
++
+ use strict;
+-use Test::More tests => 4;
++use Test::More tests => 5;
+ use Feed::Find;
+ use LWP::UserAgent;
+
+-use constant BASE => 'http://stupidfool.org/perl/feeds/';
++my $port = $ENV{CGI_APP_SERVER_TEST_PORT} || 40000 + int(rand(10000));
++
++my $s = My::WebServer->new($port);
++$s->document_root('./t/htdocs');
++
++my $url_root = $s->started_ok("start up my web server");
++
++# generate our anchors-only.html file to get the URL correct in the links
++my $anchor_html = <<"END";
++<html>
++ <head>
++ <link rel="alternate" title="my feed"
++ href="$url_root/ok.xml" type="application/xml" />
++ <head>
++ <body>
++ <a href="$url_root/ok.xml" type="application/xml">my feed</a>
++ </body>
++</html>
++END
+
+-my(@feeds);
++open(my $fh, ">./t/htdocs/anchors-only.html") or
++ die "Cannot open file\n";
++print $fh <<"END";
++<html>
++ <head>
++ <link rel="alternate" title="my feed"
++ href="$url_root/ok.xml" type="application/xml" />
++ <head>
++ <body>
++ <a href="$url_root/ok.xml" type="application/xml">my feed</a>
++ </body>
++</html>
++END
++close $fh;
+
+-@feeds = Feed::Find->find(BASE . 'anchors-only.html');
++my @feeds = ();
++@feeds = Feed::Find->find("$url_root/anchors-only.html");
+ is(scalar @feeds, 1);
+-is($feeds[0], BASE . 'ok.xml');
++is($feeds[0], "$url_root/ok.xml");
+
+ my $ua = LWP::UserAgent->new;
+ $ua->env_proxy;
+-my $req = HTTP::Request->new(GET => BASE . 'anchors-only.html');
++my $req = HTTP::Request->new(GET => "$url_root/anchors-only.html");
+ my $res = $ua->request($req);
+-@feeds = Feed::Find->find_in_html(\$res->content, BASE . 'anchors-only.html');
++@feeds = Feed::Find->find_in_html(\$res->content, "$url_root/anchors-only.html");
+ is(scalar @feeds, 1);
+-is($feeds[0], BASE . 'ok.xml');
++is($feeds[0], "$url_root/ok.xml");
+diff --git a/t/htdocs/anchors-only.html b/t/htdocs/anchors-only.html
+new file mode 100644
+index 0000000..79f1df8
+--- /dev/null
++++ b/t/htdocs/anchors-only.html
+@@ -0,0 +1,9 @@
++<html>
++ <head>
++ <link rel="alternate" title="my feed"
++ href="http://localhost:45578/ok.xml" type="application/xml" />
++ <head>
++ <body>
++ <a href="http://localhost:45578/ok.xml" type="application/xml">my feed</a>
++ </body>
++</html>
+--
+2.28.0
+
diff --git a/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch b/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch
new file mode 100644
index 000000000000..ae60d0f1f7b1
--- /dev/null
+++ b/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch
@@ -0,0 +1,21 @@
+From b624dda904b26792464697a1c5e7b210be410eff Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentnl@gentoo.org>
+Date: Fri, 21 Aug 2020 21:06:23 +1200
+Subject: Include '.' in @INC for perl 5.26+
+
+---
+ Makefile.PL | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 64e091c..34b5c67 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,3 +1,4 @@
++use lib q[.];
+ use inc::Module::Install;
+ name 'Feed-Find';
+ all_from 'lib/Feed/Find.pm';
+--
+2.28.0
+