[perl-URI-Find-Simple] Do not expect URI::Find normalizes URIs
Petr Pisar
ppisar at fedoraproject.org
Mon Aug 4 13:18:53 UTC 2014
commit bbc10024696001c5ea6c3de697277255cf90f12c
Author: Petr Písař <ppisar at redhat.com>
Date: Mon Aug 4 15:12:18 2014 +0200
Do not expect URI::Find normalizes URIs
...05-Do-not-expect-URI-Find-normalizes-URIs.patch | 63 ++++++++++++++++++++
perl-URI-Find-Simple.spec | 8 ++-
2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/URI-Find-Simple-1.05-Do-not-expect-URI-Find-normalizes-URIs.patch b/URI-Find-Simple-1.05-Do-not-expect-URI-Find-normalizes-URIs.patch
new file mode 100644
index 0000000..6f587f8
--- /dev/null
+++ b/URI-Find-Simple-1.05-Do-not-expect-URI-Find-normalizes-URIs.patch
@@ -0,0 +1,63 @@
+From e8ed5732a15818129fca7d12bf1c0eea5e09d385 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Mon, 4 Aug 2014 14:25:16 +0200
+Subject: [PATCH] Do not expect URI::Find normalize URIs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+URI-Find-20140709 stopped translating URIs to canonical form
+(http://cpansearch.perl.org/src/MSCHWERN/URI-Find-20140709/Changes).
+
+As URI::Find documentation quotes non-canonical input with
+non-canonical output, I assume the non-canonical output is expected,
+so I changed the tests instead of the code.
+
+CPAN RT#97738
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ t/find.t | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/t/find.t b/t/find.t
+index 978740a..1205d94 100644
+--- a/t/find.t
++++ b/t/find.t
+@@ -24,8 +24,8 @@ EOF
+ ok(my @list = URI::Find::Simple::list_uris($text), "got list of uris");
+
+ is(scalar(@list), 4, "got 4 uris");
+-is($list[0], 'http://www.news.com/', "got news.com uri");
+-is($list[1], 'http://various.com/', "got various.com uri");
++like($list[0], qr{\Qhttp://www.news.com\E/?}, "got news.com uri");
++like($list[1], qr{\Qhttp://various.com\E/?}, "got various.com uri");
+ is($list[2], 'mailto:tom at jerakeen.org', "got email address");
+ is($list[3], 'ftp://not.http.urls/and/have/paths', "got ftp uri");
+
+@@ -34,16 +34,16 @@ ok(my $new_text = URI::Find::Simple::change_uris($text, sub {
+ return "[[ $text ]]";
+ }), "changed text");
+
+-ok(my $expected = <<EOF, "set expected text string");
+-this is a long string with [[ http://www.news.com/ ]] urls in it in
+-[[ http://various.com/ ]] different forms. [[ mailto:tom\@jerakeen.org ]].
++my $expected = qr{\A\Qthis is a long string with [[ http://www.news.com\E/?\Q ]] urls in it in
++[[ http://various.com\E/?\Q ]] different forms. [[ mailto:tom\E\@\Qjerakeen.org ]].
+ Some urls are [[ ftp://not.http.urls/and/have/paths ]].
+-EOF
++\E\z};
++ok($expected, "set expected text string");
+
+-is($new_text, $expected, "expcted matches new text");
++like($new_text, $expected, "expcted matches new text");
+
+ my $unicode = "This is a unicode string with a http://weird.com/url/\x{e9}withunicode ok";
+ @list = URI::Find::Simple::list_uris($unicode);
+
+ is(scalar(@list), 1, "got 1 uri");
+-is($list[0], 'http://weird.com/url/%C3%A9withunicode', "got news.com uri");
++like($list[0], qr{\Qhttp://weird.com/url/%\E[cC]\Q3%\E[aA]\Q9withunicode\E}, "got news.com uri");
+--
+1.9.3
+
diff --git a/perl-URI-Find-Simple.spec b/perl-URI-Find-Simple.spec
index 71109aa..06a0a7e 100644
--- a/perl-URI-Find-Simple.spec
+++ b/perl-URI-Find-Simple.spec
@@ -1,11 +1,13 @@
Name: perl-URI-Find-Simple
Version: 1.05
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Simple interface to URI::Find
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/URI-Find-Simple/
Source0: http://www.cpan.org/authors/id/T/TO/TOMI/URI-Find-Simple-%{version}.tar.gz
+# Do not expect URI::Find normalizes URIs, bug #1124417, CPAN RT#97738
+Patch0: URI-Find-Simple-1.05-Do-not-expect-URI-Find-normalizes-URIs.patch
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl(Carp)
@@ -28,6 +30,7 @@ functions - one to list all the uris, and one to change all the uris.
%prep
%setup -q -n URI-Find-Simple-%{version}
+%patch0 -p1
%build
perl Makefile.PL INSTALLDIRS=vendor
@@ -47,6 +50,9 @@ make test
%{_mandir}/man3/*
%changelog
+* Mon Aug 04 2014 Petr Pisar <ppisar at redhat.com> - 1.05-3
+- Do not expect URI::Find normalizes URIs (bug #1124417)
+
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.05-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
More information about the scm-commits
mailing list