1 |
commit: 491e75c9555192102acfda589f7a73193cfaafed |
2 |
Author: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 21 14:20:41 2020 +0000 |
4 |
Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 21 14:22:08 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=491e75c9 |
7 |
|
8 |
dev-perl/Feed-Find: -r bump for EAPI7 and a LOT of fixes |
9 |
|
10 |
- EAPI7 |
11 |
- Convert 'sed' hack to a patch |
12 |
- Strip bundled deps in inc/ which got used in testing and reported |
13 |
bogus warnings that will probably become fatal in future, in favour ot |
14 |
using system dependencies. |
15 |
- Inhale a modified version of a set of patches submitted upstream that |
16 |
makes the http tests not require a live internet connection to be |
17 |
tested, at the cost of *many* dependencies. But manual steps are no |
18 |
longer required to properly test this \o/ |
19 |
|
20 |
Bug: https://github.com/btrott/Feed-Find/pull/2 |
21 |
Package-Manager: Portage-2.3.103, Repoman-2.3.22 |
22 |
Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org> |
23 |
|
24 |
dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild | 61 ++++++++++++ |
25 |
.../files/Feed-Find-0.07-local-network.patch | 109 +++++++++++++++++++++ |
26 |
.../files/Feed-Find-0.07-no-dot-inc.patch | 21 ++++ |
27 |
3 files changed, 191 insertions(+) |
28 |
|
29 |
diff --git a/dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild b/dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..3e1c6d265b5 |
32 |
--- /dev/null |
33 |
+++ b/dev-perl/Feed-Find/Feed-Find-0.70.0-r3.ebuild |
34 |
@@ -0,0 +1,61 @@ |
35 |
+# Copyright 1999-2020 Gentoo Authors |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+EAPI=7 |
39 |
+ |
40 |
+DIST_AUTHOR=BTROTT |
41 |
+DIST_VERSION=0.07 |
42 |
+inherit perl-module |
43 |
+ |
44 |
+DESCRIPTION="Syndication feed auto-discovery" |
45 |
+ |
46 |
+SLOT="0" |
47 |
+KEYWORDS="~amd64 ~x86" |
48 |
+IUSE="test" |
49 |
+RESTRICT="!test? ( test )" |
50 |
+ |
51 |
+RDEPEND=" |
52 |
+ dev-perl/Class-ErrorHandler |
53 |
+ dev-perl/HTML-Parser |
54 |
+ dev-perl/libwww-perl |
55 |
+ dev-perl/URI |
56 |
+" |
57 |
+BDEPEND="${RDEPEND} |
58 |
+ test? ( |
59 |
+ dev-perl/Test-Base |
60 |
+ dev-perl/CGI-Application-Server |
61 |
+ dev-perl/Test-HTTP-Server-Simple |
62 |
+ ) |
63 |
+" |
64 |
+PATCHES=( |
65 |
+ "${FILESDIR}/${PN}-0.07-no-dot-inc.patch" |
66 |
+ "${FILESDIR}/${PN}-0.07-local-network.patch" |
67 |
+) |
68 |
+PERL_RM_FILES=( |
69 |
+ inc/Spiffy.pm |
70 |
+ inc/Test/Base.pm |
71 |
+ inc/Test/Base/Filter.pm |
72 |
+ inc/Test/Builder.pm |
73 |
+ inc/Test/Builder/Module.pm |
74 |
+ inc/Test/More.pm |
75 |
+) |
76 |
+src_test() { |
77 |
+ local MODULES=( |
78 |
+ "Feed::Find ${DIST_VERSION}" |
79 |
+ ) |
80 |
+ local failed=() |
81 |
+ for dep in "${MODULES[@]}"; do |
82 |
+ ebegin "Compile testing ${dep}" |
83 |
+ perl -Mblib="${S}" -M"${dep} ()" -e1 |
84 |
+ eend $? || failed+=( "$dep" ) |
85 |
+ done |
86 |
+ if [[ ${failed[@]} ]]; then |
87 |
+ echo |
88 |
+ eerror "One or more modules failed compile:"; |
89 |
+ for dep in "${failed[@]}"; do |
90 |
+ eerror " ${dep}" |
91 |
+ done |
92 |
+ die "Failing due to module compilation errors"; |
93 |
+ fi |
94 |
+ perl-module_src_test |
95 |
+} |
96 |
|
97 |
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 |
98 |
new file mode 100644 |
99 |
index 00000000000..4cf8f567547 |
100 |
--- /dev/null |
101 |
+++ b/dev-perl/Feed-Find/files/Feed-Find-0.07-local-network.patch |
102 |
@@ -0,0 +1,109 @@ |
103 |
+From bea092aae37300053b971a12b6e37b6104df41f9 Mon Sep 17 00:00:00 2001 |
104 |
+From: Nikolay Mishin <mi@××.ru> |
105 |
+Date: Thu, 22 Oct 2015 02:59:04 +0400 |
106 |
+Subject: Rework 01-find.t |
107 |
+ |
108 |
+Rework test to not rely on external web resources by mocking the setup |
109 |
+with a HTTP::Server::Simple derived webserver |
110 |
+ |
111 |
+Bug: https://github.com/btrott/Feed-Find/pull/2 |
112 |
+Signed-off-by: Gary Greene <greeneg@××××××××××.net> |
113 |
+Signed-off-by: Kent Fredric <kentnl@g.o> |
114 |
+--- |
115 |
+ t/01-find.t | 57 ++++++++++++++++++++++++++++++++------ |
116 |
+ t/htdocs/anchors-only.html | 9 ++++++ |
117 |
+ 2 files changed, 58 insertions(+), 8 deletions(-) |
118 |
+ create mode 100644 t/htdocs/anchors-only.html |
119 |
+ |
120 |
+diff --git a/t/01-find.t b/t/01-find.t |
121 |
+index 58549b5..22d0048 100644 |
122 |
+--- a/t/01-find.t |
123 |
++++ b/t/01-find.t |
124 |
+@@ -1,20 +1,61 @@ |
125 |
++use CGI::Application::Server; |
126 |
++use Test::HTTP::Server::Simple; |
127 |
++ |
128 |
++package My::WebServer { |
129 |
++ use base qw/Test::HTTP::Server::Simple CGI::Application::Server/; |
130 |
++} |
131 |
++ |
132 |
++package main; |
133 |
++ |
134 |
+ use strict; |
135 |
+-use Test::More tests => 4; |
136 |
++use Test::More tests => 5; |
137 |
+ use Feed::Find; |
138 |
+ use LWP::UserAgent; |
139 |
+ |
140 |
+-use constant BASE => 'http://stupidfool.org/perl/feeds/'; |
141 |
++my $port = $ENV{CGI_APP_SERVER_TEST_PORT} || 40000 + int(rand(10000)); |
142 |
++ |
143 |
++my $s = My::WebServer->new($port); |
144 |
++$s->document_root('./t/htdocs'); |
145 |
++ |
146 |
++my $url_root = $s->started_ok("start up my web server"); |
147 |
++ |
148 |
++# generate our anchors-only.html file to get the URL correct in the links |
149 |
++my $anchor_html = <<"END"; |
150 |
++<html> |
151 |
++ <head> |
152 |
++ <link rel="alternate" title="my feed" |
153 |
++ href="$url_root/ok.xml" type="application/xml" /> |
154 |
++ <head> |
155 |
++ <body> |
156 |
++ <a href="$url_root/ok.xml" type="application/xml">my feed</a> |
157 |
++ </body> |
158 |
++</html> |
159 |
++END |
160 |
+ |
161 |
+-my(@feeds); |
162 |
++open(my $fh, ">./t/htdocs/anchors-only.html") or |
163 |
++ die "Cannot open file\n"; |
164 |
++print $fh <<"END"; |
165 |
++<html> |
166 |
++ <head> |
167 |
++ <link rel="alternate" title="my feed" |
168 |
++ href="$url_root/ok.xml" type="application/xml" /> |
169 |
++ <head> |
170 |
++ <body> |
171 |
++ <a href="$url_root/ok.xml" type="application/xml">my feed</a> |
172 |
++ </body> |
173 |
++</html> |
174 |
++END |
175 |
++close $fh; |
176 |
+ |
177 |
+-@feeds = Feed::Find->find(BASE . 'anchors-only.html'); |
178 |
++my @feeds = (); |
179 |
++@feeds = Feed::Find->find("$url_root/anchors-only.html"); |
180 |
+ is(scalar @feeds, 1); |
181 |
+-is($feeds[0], BASE . 'ok.xml'); |
182 |
++is($feeds[0], "$url_root/ok.xml"); |
183 |
+ |
184 |
+ my $ua = LWP::UserAgent->new; |
185 |
+ $ua->env_proxy; |
186 |
+-my $req = HTTP::Request->new(GET => BASE . 'anchors-only.html'); |
187 |
++my $req = HTTP::Request->new(GET => "$url_root/anchors-only.html"); |
188 |
+ my $res = $ua->request($req); |
189 |
+-@feeds = Feed::Find->find_in_html(\$res->content, BASE . 'anchors-only.html'); |
190 |
++@feeds = Feed::Find->find_in_html(\$res->content, "$url_root/anchors-only.html"); |
191 |
+ is(scalar @feeds, 1); |
192 |
+-is($feeds[0], BASE . 'ok.xml'); |
193 |
++is($feeds[0], "$url_root/ok.xml"); |
194 |
+diff --git a/t/htdocs/anchors-only.html b/t/htdocs/anchors-only.html |
195 |
+new file mode 100644 |
196 |
+index 0000000..79f1df8 |
197 |
+--- /dev/null |
198 |
++++ b/t/htdocs/anchors-only.html |
199 |
+@@ -0,0 +1,9 @@ |
200 |
++<html> |
201 |
++ <head> |
202 |
++ <link rel="alternate" title="my feed" |
203 |
++ href="http://localhost:45578/ok.xml" type="application/xml" /> |
204 |
++ <head> |
205 |
++ <body> |
206 |
++ <a href="http://localhost:45578/ok.xml" type="application/xml">my feed</a> |
207 |
++ </body> |
208 |
++</html> |
209 |
+-- |
210 |
+2.28.0 |
211 |
+ |
212 |
|
213 |
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 |
214 |
new file mode 100644 |
215 |
index 00000000000..ae60d0f1f7b |
216 |
--- /dev/null |
217 |
+++ b/dev-perl/Feed-Find/files/Feed-Find-0.07-no-dot-inc.patch |
218 |
@@ -0,0 +1,21 @@ |
219 |
+From b624dda904b26792464697a1c5e7b210be410eff Mon Sep 17 00:00:00 2001 |
220 |
+From: Kent Fredric <kentnl@g.o> |
221 |
+Date: Fri, 21 Aug 2020 21:06:23 +1200 |
222 |
+Subject: Include '.' in @INC for perl 5.26+ |
223 |
+ |
224 |
+--- |
225 |
+ Makefile.PL | 1 + |
226 |
+ 1 file changed, 1 insertion(+) |
227 |
+ |
228 |
+diff --git a/Makefile.PL b/Makefile.PL |
229 |
+index 64e091c..34b5c67 100644 |
230 |
+--- a/Makefile.PL |
231 |
++++ b/Makefile.PL |
232 |
+@@ -1,3 +1,4 @@ |
233 |
++use lib q[.]; |
234 |
+ use inc::Module::Install; |
235 |
+ name 'Feed-Find'; |
236 |
+ all_from 'lib/Feed/Find.pm'; |
237 |
+-- |
238 |
+2.28.0 |
239 |
+ |