[perl-DBD-CSV/epel7] Add upstream fix for t/48_utf8.t to work with Text::CSV_XS ≥ 0.99

Paul Howarth pghmcfc at fedoraproject.org
Wed Jan 29 15:32:23 UTC 2014


commit edf5a566cabf6c9623e1458537b131dbe120ab92
Author: Paul Howarth <paul at city-fan.org>
Date:   Wed Jan 29 15:32:25 2014 +0000

    Add upstream fix for t/48_utf8.t to work with Text::CSV_XS ≥ 0.99

 .gitignore                   |    8 +-----
 DBD-CSV-0.38-utf8-test.patch |   53 ++++++++++++++++++++++++++++++++++++++++++
 perl-DBD-CSV.spec            |   13 ++++++++--
 3 files changed, 64 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2a4c754..53e2f61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1 @@
-DBD-CSV-0.30.tgz
-/DBD-CSV-0.31.tgz
-/DBD-CSV-0.33.tgz
-/DBD-CSV-0.34.tgz
-/DBD-CSV-0.35.tgz
-/DBD-CSV-0.36.tgz
-/DBD-CSV-0.38.tgz
+/DBD-CSV-[0-9.]*.tgz
diff --git a/DBD-CSV-0.38-utf8-test.patch b/DBD-CSV-0.38-utf8-test.patch
new file mode 100644
index 0000000..95dd564
--- /dev/null
+++ b/DBD-CSV-0.38-utf8-test.patch
@@ -0,0 +1,53 @@
+From c88436e0e97fb4efba5432add1af480bcaa099b1 Mon Sep 17 00:00:00 2001
+From: "H.Merijn Brand - Tux" <h.m.brand at xs4all.nl>
+Date: Tue, 11 Jun 2013 14:48:52 +0200
+Subject: [PATCH] Text::CSV_XS is allowed to return encoded data if valid UTF-8
+
+Text::CSV_XS 0.99 fixed automatic encoding of valid UTF-8
+---
+ sandbox/genMETA.pl | 2 +-
+ t/48_utf8.t        | 8 ++++++--
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+#diff --git a/sandbox/genMETA.pl b/sandbox/genMETA.pl
+#index 3ea13e1..4ddde8a 100755
+#--- a/sandbox/genMETA.pl
+#+++ b/sandbox/genMETA.pl
+#@@ -67,7 +67,7 @@
+#     charnames:           0
+# recommends:
+#     perl:                5.016003
+#-    Test::More:          0.98
+#+    Test::More:          0.99
+# installdirs:             site
+# resources:
+#     license:             http://dev.perl.org/licenses/
+diff --git a/t/48_utf8.t b/t/48_utf8.t
+index 04a5d91..0230b4f 100644
+--- a/t/48_utf8.t
++++ b/t/48_utf8.t
+@@ -43,7 +43,9 @@ foreach my $tbl ($tbl1, $tbl2) {
+     ok ($sth->execute,				"execute");
+     foreach my $i (1 .. scalar @data) {
+ 	ok ($row = $sth->fetch,			"fetch $i");
+-	is_deeply ($row, [ $i , encode ("utf8", $data[$i - 1]) ],	"unencoded content $i");
++	my $v = $data[$i - 1];
++	utf8::is_utf8 ($v) or $v = encode ("utf8", $v);
++	is_deeply ($row, [ $i , $v ],		"unencoded content $i");
+ 	}
+     ok ($sth->finish,				"finish");
+     undef $sth;
+@@ -57,7 +59,9 @@ foreach my $tbl ($tbl1, $tbl2) {
+     ok ($sth->execute,				"execute");
+     foreach my $i (1 .. scalar @data) {
+ 	ok ($row = $sth->fetch,			"fetch $i");
+-	is_deeply ($row, [ $i , $data[$i - 1] ],	"encoded content $i");
++	my $v = $data[$i - 1];
++	ok (utf8::is_utf8 ($v),			"is encoded");
++	is_deeply ($row, [ $i , $v ],		"encoded content $i");
+ 	}
+     ok ($sth->finish,				"finish");
+     undef $sth;
+-- 
+1.8.5.1
+
diff --git a/perl-DBD-CSV.spec b/perl-DBD-CSV.spec
index aabb4ae..57ce388 100644
--- a/perl-DBD-CSV.spec
+++ b/perl-DBD-CSV.spec
@@ -1,11 +1,12 @@
 Name:           perl-DBD-CSV
 Version:        0.38
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        DBI driver for CSV files
 Group:          Development/Libraries
 License:        GPL+ or Artistic
 URL:            http://search.cpan.org/dist/DBD-CSV/
 Source0:        http://search.cpan.org/CPAN/authors/id/H/HM/HMBRAND/DBD-CSV-%{version}.tgz
+Patch0:         DBD-CSV-0.38-utf8-test.patch
 BuildArch:      noarch
 BuildRequires:  perl(Carp)
 BuildRequires:  perl(Cwd)
@@ -17,12 +18,12 @@ BuildRequires:  perl(File::Spec)
 BuildRequires:  perl(IO::File)
 BuildRequires:  perl(SQL::Statement) >= 1.402
 BuildRequires:  perl(Test::More) >= 0.98
-BuildRequires:  perl(Text::CSV_XS) >= 0.94
+BuildRequires:  perl(Text::CSV_XS) >= 0.99
 Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
 Requires:       perl(DBD::File) >= 0.41
 Requires:       perl(DBI) >= 1.623
 Requires:       perl(SQL::Statement) >= 1.402
-Requires:       perl(Text::CSV_XS) >= 0.94
+Requires:       perl(Text::CSV_XS) >= 0.99
 
 %global __requires_exclude %{?__requires_exclude:__requires_exclude|}^perl\\(DBD::File\\)$
 %global __requires_exclude %__requires_exclude|^perl\\(Text::CSV_XS\\)$
@@ -39,6 +40,9 @@ MS Excel data.
 %setup -q -n DBD-CSV-%{version}
 chmod -c a-x ChangeLog README lib/DBD/*.pm lib/Bundle/DBD/*.pm
 
+# Fix t/48_utf8.t to work with Text::CSV_XS ≥ 0.99 (upstream commit)
+%patch0 -p1
+
 %build
 perl Makefile.PL INSTALLDIRS=vendor
 make %{?_smp_mflags}
@@ -58,6 +62,9 @@ make test
 %{_mandir}/man3/*.3pm*
 
 %changelog
+* Wed Jan 29 2014 Paul Howarth <paul at city-fan.org> - 0.38-3
+- Add upstream fix for t/48_utf8.t to work with Text::CSV_XS ≥ 0.99
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.38-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list