[perl-Test-EOL] Don't assume tested files are UTF-8 encoded (CPAN RT#59877)
Paul Howarth
pghmcfc at fedoraproject.org
Mon Oct 18 10:47:24 UTC 2010
commit dbbe8bc88fb1907eb4daf7480631303acd91be68
Author: Paul Howarth <paul at city-fan.org>
Date: Mon Oct 18 11:46:51 2010 +0100
Don't assume tested files are UTF-8 encoded (CPAN RT#59877)
Test-EOL-0.9-rt59877.patch | 40 ++++++++++++++++++++++++++++++++++++++++
perl-Test-EOL.spec | 9 ++++++++-
2 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/Test-EOL-0.9-rt59877.patch b/Test-EOL-0.9-rt59877.patch
new file mode 100644
index 0000000..b833f4b
--- /dev/null
+++ b/Test-EOL-0.9-rt59877.patch
@@ -0,0 +1,40 @@
+When a tested file contains Latin-1 chars, Test::EOL issues warnings and
+fails if trailing_whitespace option is turned on.
+
+diff -up Test-EOL-0.9/lib/Test/EOL.pm Test-EOL-0.9/lib/Test/EOL.pm
+--- Test-EOL-0.9/lib/Test/EOL.pm 2010-06-16 15:05:07.000000000 +0100
++++ Test-EOL-0.9/lib/Test/EOL.pm 2010-10-18 09:58:18.077182938 +0100
+@@ -104,7 +104,7 @@ sub eol_unix_ok {
+
+ open my $fh, $file or do { $Test->ok(0, $test_txt); $Test->diag("Could not open $file: $!"); return; };
+ # Windows-- , default is :crlf, which hides \r\n -_-
+- binmode( $fh, ':raw:utf8' );
++ binmode( $fh, ':raw' );
+ my $line = 0;
+ my @fails;
+ while (<$fh>) {
+diff -up /dev/null Test-EOL-0.9/t/13-latin1.t
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ Test-EOL-0.9/t/13-latin1.t 2010-10-18 09:57:00.019168309 +0100
+@@ -0,0 +1,21 @@
++use strict;
++
++use Test::More tests => 1;
++
++use Test::EOL;
++
++use File::Temp 'tempfile';
++
++my $file5 = make_file5();
++eol_unix_ok( $file5, { trailing_whitespace => 1 });
++
++unlink $file5;
++
++sub make_file5 {
++ my ($fh, $filename) = tempfile();
++ print $fh <<'DUMMY';
++#!/usr/bin/perl
++print "Grüße!\n";
++DUMMY
++ return $filename;
++}
diff --git a/perl-Test-EOL.spec b/perl-Test-EOL.spec
index 36081fb..a49a4d7 100644
--- a/perl-Test-EOL.spec
+++ b/perl-Test-EOL.spec
@@ -3,13 +3,14 @@
Name: perl-Test-EOL
Version: 0.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Check the correct line endings in your project
Group: Development/Libraries
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/Test-EOL/
Source0: http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Test-EOL-%{version}.tar.gz
Patch0: Test-EOL-0.8-old-EU::MM.patch
+Patch1: Test-EOL-0.9-rt59877.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker)
@@ -38,6 +39,9 @@ whitespace.
%patch0 -p1
%endif
+# Don't assume tested files are UTF-8 encoded (CPAN RT#59877)
+%patch1 -p1
+
%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
@@ -62,6 +66,9 @@ rm -rf %{buildroot}
%{_mandir}/man3/Test::EOL.3pm*
%changelog
+* Mon Oct 18 2010 Paul Howarth <paul at city-fan.org> 0.9-2
+- Don't assume tested files are UTF-8 encoded (CPAN RT#59877)
+
* Wed Jun 16 2010 Paul Howarth <paul at city-fan.org> 0.9-1
- Update to 0.9 (fix warnings on very old perls - CPAN RT#58442)
- Use DESTDIR instead of PERL_INSTALL_ROOT
More information about the scm-commits
mailing list