r52966 - in /trunk/libtext-csv-xs-perl: ./ debian/ examples/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Feb 17 19:23:54 UTC 2010


Author: jawnsy-guest
Date: Wed Feb 17 19:23:47 2010
New Revision: 52966

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=52966
Log:
* New upstream release
* Update copyright to new DEP5 format
* Standards-Version 3.8.4 (no changes)

Added:
    trunk/libtext-csv-xs-perl/t/51_utf8.t
      - copied unchanged from r52959, branches/upstream/libtext-csv-xs-perl/current/t/51_utf8.t
Modified:
    trunk/libtext-csv-xs-perl/CSV_XS.pm
    trunk/libtext-csv-xs-perl/CSV_XS.xs
    trunk/libtext-csv-xs-perl/ChangeLog
    trunk/libtext-csv-xs-perl/MANIFEST
    trunk/libtext-csv-xs-perl/META.yml
    trunk/libtext-csv-xs-perl/Makefile.PL
    trunk/libtext-csv-xs-perl/README
    trunk/libtext-csv-xs-perl/debian/changelog
    trunk/libtext-csv-xs-perl/debian/control
    trunk/libtext-csv-xs-perl/debian/copyright
    trunk/libtext-csv-xs-perl/examples/csv-check
    trunk/libtext-csv-xs-perl/examples/csv2xls
    trunk/libtext-csv-xs-perl/examples/parser-xs.pl
    trunk/libtext-csv-xs-perl/examples/speed.pl
    trunk/libtext-csv-xs-perl/t/50_utf8.t
    trunk/libtext-csv-xs-perl/t/80_diag.t

Modified: trunk/libtext-csv-xs-perl/CSV_XS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/CSV_XS.pm?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/CSV_XS.pm (original)
+++ trunk/libtext-csv-xs-perl/CSV_XS.pm Wed Feb 17 19:23:47 2010
@@ -1,6 +1,6 @@
 package Text::CSV_XS;
 
-# Copyright (c) 2007-2009 H.Merijn Brand.  All rights reserved.
+# Copyright (c) 2007-2010 H.Merijn Brand.  All rights reserved.
 # Copyright (c) 1998-2001 Jochen Wiedmann. All rights reserved.
 # Portions Copyright (c) 1997 Alan Citterman. All rights reserved.
 #
@@ -30,7 +30,7 @@
 use Carp;
 
 use vars   qw( $VERSION @ISA );
-$VERSION = "0.70";
+$VERSION = "0.71";
 @ISA     = qw( DynaLoader );
 bootstrap Text::CSV_XS $VERSION;
 
@@ -114,12 +114,14 @@
 	    }
 #	croak?
 	$last_new_err = SetDiag (undef, 1000, "INI - Unknown attribute '$_'");
+	$attr->{auto_diag} and error_diag ();
 	return;
 	}
 
     my $self  = {%def_attr, %{$attr}};
     if (my $ec = _check_sanity ($self)) {
 	$last_new_err = SetDiag (undef, $ec);
+	$attr->{auto_diag} and error_diag ();
 	return;
 	}
 
@@ -351,24 +353,29 @@
 
     my $context = wantarray;
     unless (defined $context) {	# Void context, auto-diag
-	if ($diag[0] && $diag[0] != 2012 && $self && ref $self) {
+	if ($diag[0] && $diag[0] != 2012) {
 	    my $msg = "# CSV_XS ERROR: $diag[0] - $diag[1]\n";
-
-	    my $lvl = $self->{auto_diag};
-	    if ($lvl < 2) {
-		my @c = caller (2);
-		if (@c >= 11 && $c[10] && ref $c[10] eq "HASH") {
-		    my $hints = $c[10];
-		    (exists $hints->{autodie} && $hints->{autodie} or
-		     exists $hints->{"guard Fatal"} &&
-		    !exists $hints->{"no Fatal"}) and
-			$lvl++;
-		    # Future releases of autodie will probably set $^H{autodie}
-		    #  to "autodie @args", like "autodie :all" or "autodie open"
-		    #  so we can/should check for "open" or "new"
+	    if ($self && ref $self) {	# auto_diag
+
+		my $lvl = $self->{auto_diag};
+		if ($lvl < 2) {
+		    my @c = caller (2);
+		    if (@c >= 11 && $c[10] && ref $c[10] eq "HASH") {
+			my $hints = $c[10];
+			(exists $hints->{autodie} && $hints->{autodie} or
+			 exists $hints->{"guard Fatal"} &&
+			!exists $hints->{"no Fatal"}) and
+			    $lvl++;
+			# Future releases of autodie will probably set $^H{autodie}
+			#  to "autodie @args", like "autodie :all" or "autodie open"
+			#  so we can/should check for "open" or "new"
+			}
 		    }
+		$lvl > 1 ? die $msg : warn $msg;
 		}
-	    $lvl > 1 ? die $msg : warn $msg;
+	    else {	# called without args in void context
+		warn $msg;
+		}
 	    }
 	return;
 	}
@@ -1699,7 +1706,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2007-2009 H.Merijn Brand for PROCURA B.V.
+Copyright (C) 2007-2010 H.Merijn Brand for PROCURA B.V.
 Copyright (C) 1998-2001 Jochen Wiedmann. All rights reserved.
 Portions Copyright (C) 1997 Alan Citterman. All rights reserved.
 

Modified: trunk/libtext-csv-xs-perl/CSV_XS.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/CSV_XS.xs?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/CSV_XS.xs (original)
+++ trunk/libtext-csv-xs-perl/CSV_XS.xs Wed Feb 17 19:23:47 2010
@@ -1,4 +1,4 @@
-/*  Copyright (c) 2007-2009 H.Merijn Brand.  All rights reserved.
+/*  Copyright (c) 2007-2010 H.Merijn Brand.  All rights reserved.
  *  Copyright (c) 1998-2001 Jochen Wiedmann. All rights reserved.
  *  This program is free software; you can redistribute it and/or
  *  modify it under the same terms as Perl itself.
@@ -21,6 +21,9 @@
 #  define SvUTF8_on(sv)	/* no-op */
 #  define SvUTF8(sv)	0
 #  endif
+#ifndef PERLIO_F_UTF8
+#  define PERLIO_F_UTF8	0x00008000
+#  endif
 
 #define MAINT_DEBUG	0
 
@@ -358,7 +361,7 @@
     else if ((svp = hv_fetchs (hv, "eol", FALSE)) && *svp && SvOK (*svp)) {
 	STRLEN len;
 	byte *eol = (byte *)SvPV (*svp, len);
-	_cache_show_str  ("eol", len,		eol);
+	_cache_show_str  ("eol", (int)len,	eol);
 	}
     else
 	_cache_show_str  ("eol", 8,		(byte *)"<broken>");
@@ -567,6 +570,8 @@
 	PUSHs ((dst));
 	PUSHs (tmp);
 	PUTBACK;
+	if (csv->utf8)
+	    SvUTF8_on (tmp);
 	result = call_sv (m_print, G_SCALAR | G_METHOD);
 	SPAGAIN;
 	if (result) {

Modified: trunk/libtext-csv-xs-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/ChangeLog?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/ChangeLog (original)
+++ trunk/libtext-csv-xs-perl/ChangeLog Wed Feb 17 19:23:47 2010
@@ -1,3 +1,12 @@
+2010-02-15 0.71 - H.Merijn Brand   <h.m.brand at xs4all.nl>
+
+    * Upped copyright to 2010
+    * Prevent double encoding: make Text::CSV_XS streams behave just
+      like perl would (thanks ikegami for the test cases)
+    * Text::CSV_XS->error_diag () in void context now warns instead of
+      doing nothing
+    * auto_diag also used for new () itself
+
 2009-12-02 0.70 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
     * Add quote_space attribute

Modified: trunk/libtext-csv-xs-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/MANIFEST?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/MANIFEST (original)
+++ trunk/libtext-csv-xs-perl/MANIFEST Wed Feb 17 19:23:47 2010
@@ -20,6 +20,7 @@
 t/41_null.t		NULL test in combination with line endings
 t/45_eol.t		Embedded EOL
 t/50_utf8.t		Unicode stress tests
+t/51_utf8.t		Unicode IO encoding tests
 t/55_combi.t		Different CSV character combinations
 t/60_samples.t		Miscellaneous problems from the modules history.
 t/65_allow.t		Allow bad formats

Modified: trunk/libtext-csv-xs-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/META.yml?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/META.yml (original)
+++ trunk/libtext-csv-xs-perl/META.yml Wed Feb 17 19:23:47 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.1
 name:                    Text-CSV_XS
-version:                 0.70
+version:                 0.71
 abstract:                Comma-Separated Values manipulation routines
 license:                 perl
 author:              
@@ -10,7 +10,7 @@
 provides:
     Text::CSV_XS:
         file:            CSV_XS.pm
-        version:         0.70
+        version:         0.71
 requires:     
     perl:                5.005
     DynaLoader:          0

Modified: trunk/libtext-csv-xs-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/Makefile.PL?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/Makefile.PL (original)
+++ trunk/libtext-csv-xs-perl/Makefile.PL Wed Feb 17 19:23:47 2010
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# Copyright PROCURA B.V. (c) 2006-2009 H.Merijn Brand
+# Copyright PROCURA B.V. (c) 2006-2010 H.Merijn Brand
 
 require 5.005; # <- also see postamble at the bottom for META.yml
 use strict;

Modified: trunk/libtext-csv-xs-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/README?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/README (original)
+++ trunk/libtext-csv-xs-perl/README Wed Feb 17 19:23:47 2010
@@ -7,7 +7,7 @@
     fields into a CSV string and parse a CSV string into fields.
 
 Copying:
-    Copyright (c) 2007-2009 H.Merijn Brand.  All rights reserved.
+    Copyright (c) 2007-2010 H.Merijn Brand.  All rights reserved.
     Copyright (c) 1998-2001 Jochen Wiedmann. All rights reserved.
     Portions Copyright (c) 1997 Alan Citterman. All rights reserved.
 

Modified: trunk/libtext-csv-xs-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/debian/changelog?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/debian/changelog (original)
+++ trunk/libtext-csv-xs-perl/debian/changelog Wed Feb 17 19:23:47 2010
@@ -1,3 +1,11 @@
+libtext-csv-xs-perl (0.71-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Update copyright to new DEP5 format
+  * Standards-Version 3.8.4 (no changes)
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Wed, 17 Feb 2010 14:44:32 -0500
+
 libtext-csv-xs-perl (0.70-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libtext-csv-xs-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/debian/control?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/debian/control (original)
+++ trunk/libtext-csv-xs-perl/debian/control Wed Feb 17 19:23:47 2010
@@ -10,7 +10,7 @@
  Ansgar Burchardt <ansgar at 43-1.org>, Jonathan Yu <jawnsy at cpan.org>,
  Jose Luis Rivas <ghostbar at debian.org>,
  Ryan Niebur <ryan at debian.org>
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
 Homepage: http://search.cpan.org/dist/Text-CSV_XS/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtext-csv-xs-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libtext-csv-xs-perl/

Modified: trunk/libtext-csv-xs-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/debian/copyright?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/debian/copyright (original)
+++ trunk/libtext-csv-xs-perl/debian/copyright Wed Feb 17 19:23:47 2010
@@ -1,28 +1,26 @@
-Format-Specification:
-    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: H.Merijn Brand <h.m.brand at xs4all.nl>
-Upstream-Source: http://search.cpan.org/dist/Text-CSV_XS/
-Upstream-Name: Text-CSV_XS
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
+Maintainer: H.Merijn Brand <h.m.brand at xs4all.nl>
+Source: http://search.cpan.org/dist/Text-CSV_XS/
+Name: Text-CSV_XS
 
 Files: *
-Copyright: 2007-2009, H.Merijn Brand <h.m.brand at xs4all.nl>
+Copyright: 2007-2010, H.Merijn Brand <h.m.brand at xs4all.nl>
  1998-2001, Jochen Wiedmann <joe at ispsoft.de>
  1997, Alan Citterman <alan at mfgrtl.com>
-License: GPL-1+ | Artistic
+License: Artistic or GPL-1+
 
 Files: examples/csv2xls
 Copyright: 2007-2008, H.M.Brand <h.m.brand at xs4all.nl>
-License: GPL-1+ | Artistic
+License: Artistic or GPL-1+
 
 Files: ppport.h
 Copyright: 2004-2009, Marcus Holland-Moritz <mhx-cpan at gmx.net>
  2001, Paul Marquess <pmqs at cpan.org> (Version 2.x)
  1999, Kenneth Albanowski <kjahds at kjahds.com> (Version 1.x)
-License-Alias: Perl
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
 
 Files: debian/*
-Copyright: 2009, Jonathan Yu <jawnsy at cpan.org>
+Copyright: 2009-2010, Jonathan Yu <jawnsy at cpan.org>
  2009, Ryan Niebur <ryanryan52 at gmail.com>
  2008-2009, Ansgar Burchardt <ansgar at 43-1.org>
  2008, Jose Luis Rivas <ghostbar38 at gmail.com>
@@ -36,19 +34,20 @@
  2001-2004, Stephen Zander <gibreel at debian.org>
  1999, Piotr Roszatycki <dexter at debian.org>
  1998, Craig Sanders <cas at taz.net.au>
-License: GPL-1+ | Artistic
+License: Artistic or GPL-1+
 
 License: Artistic
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Artistic License, which comes with Perl.
-    On Debian GNU/Linux systems, the complete text of the Artistic License
-    can be found in `/usr/share/common-licenses/Artistic'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian GNU/Linux systems, the complete text of the Artistic License
+ can be found in `/usr/share/common-licenses/Artistic'
 
 License: GPL-1+
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 1, or (at your option)
-    any later version.
-    On Debian GNU/Linux systems, the complete text of the GNU General
-    Public License can be found in `/usr/share/common-licenses/GPL'
-
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL'

Modified: trunk/libtext-csv-xs-perl/examples/csv-check
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/examples/csv-check?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/examples/csv-check (original)
+++ trunk/libtext-csv-xs-perl/examples/csv-check Wed Feb 17 19:23:47 2010
@@ -1,7 +1,7 @@
 #!/pro/bin/perl
 
 # csv-check: Check validity of CSV file and report
-#	   (m)'09 [12 Oct 2009] Copyright H.M.Brand 2007-2009
+#	   (m)'09 [12 Oct 2009] Copyright H.M.Brand 2007-2010
 
 # This code requires the defined-or feature and PerlIO
 

Modified: trunk/libtext-csv-xs-perl/examples/csv2xls
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/examples/csv2xls?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/examples/csv2xls (original)
+++ trunk/libtext-csv-xs-perl/examples/csv2xls Wed Feb 17 19:23:47 2010
@@ -1,7 +1,7 @@
 #!/pro/bin/perl
 
 # csv2xls: Convert csv to xls
-#	   (m)'08 [22 May 2008] Copyright H.M.Brand 2007-2009
+#	   (m)'08 [22 May 2008] Copyright H.M.Brand 2007-2010
 
 use strict;
 use warnings;

Modified: trunk/libtext-csv-xs-perl/examples/parser-xs.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/examples/parser-xs.pl?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/examples/parser-xs.pl (original)
+++ trunk/libtext-csv-xs-perl/examples/parser-xs.pl Wed Feb 17 19:23:47 2010
@@ -3,7 +3,7 @@
 # This script can be used as a base to parse unreliable CSV streams
 # Modify to your own needs
 #
-#	   (m)'08 [23 Apr 2008] Copyright H.M.Brand 2008-2009
+#	   (m)'08 [23 Apr 2008] Copyright H.M.Brand 2008-2010
 
 use strict;
 use warnings;

Modified: trunk/libtext-csv-xs-perl/examples/speed.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/examples/speed.pl?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/examples/speed.pl (original)
+++ trunk/libtext-csv-xs-perl/examples/speed.pl Wed Feb 17 19:23:47 2010
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 # speed.pl: compare different versions of Text-CSV* modules
-#	   (m)'08 [07 Apr 2008] Copyright H.M.Brand 2007-2009
+#	   (m)'08 [07 Apr 2008] Copyright H.M.Brand 2007-2010
 
 require 5.005;
 use strict;

Modified: trunk/libtext-csv-xs-perl/t/50_utf8.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/t/50_utf8.t?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/t/50_utf8.t (original)
+++ trunk/libtext-csv-xs-perl/t/50_utf8.t Wed Feb 17 19:23:47 2010
@@ -31,7 +31,7 @@
 # 0D = \r  3B = ;
 foreach my $test (
   # Space-like characters
-  [ "\x{0000A0}", "U+0000A0 NO-BRAK SPACE"				],
+  [ "\x{0000A0}", "U+0000A0 NO-BREAK SPACE"				],
   [ "\x{00200B}", "U+00200B ZERO WIDTH SPACE"				],
   # Some characters with possible problems in the code point
   [ "\x{000122}", "U+000122 LATIN CAPITAL LETTER G WITH CEDILLA"	],

Modified: trunk/libtext-csv-xs-perl/t/80_diag.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/t/80_diag.t?rev=52966&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/t/80_diag.t (original)
+++ trunk/libtext-csv-xs-perl/t/80_diag.t Wed Feb 17 19:23:47 2010
@@ -3,7 +3,7 @@
 use strict;
 $^W = 1;
 
- use Test::More tests => 90;
+ use Test::More tests => 99;
 #use Test::More "no_plan";
 
 my %err;
@@ -66,6 +66,33 @@
 
 is (Text::CSV_XS->new ({ ecs_char => ":" }), undef, "Unsupported option");
 
+{   my @warn;
+    local $SIG{__WARN__} = sub { push @warn, @_ };
+    Text::CSV_XS::error_diag ();
+    ok (@warn == 1, "Error_diag in void context ::");
+    like ($warn[0], qr{^# CSV_XS ERROR: 1000 - INI}, "error content");
+    }
+{   my @warn;
+    local $SIG{__WARN__} = sub { push @warn, @_ };
+    Text::CSV_XS->error_diag ();
+    ok (@warn == 1, "Error_diag in void context ->");
+    like ($warn[0], qr{^# CSV_XS ERROR: 1000 - INI}, "error content");
+    }
+
+{   my @warn;
+    local $SIG{__WARN__} = sub { push @warn, @_ };
+    is (Text::CSV_XS->new ({ auto_diag => 0, ecs_char => ":" }), undef,
+	"Unsupported option");
+    ok (@warn == 0, "Error_diag in from new ({ auto_diag => 0})");
+    }
+{   my @warn;
+    local $SIG{__WARN__} = sub { push @warn, @_ };
+    is (Text::CSV_XS->new ({ auto_diag => 1, ecs_char => ":" }), undef,
+	"Unsupported option");
+    ok (@warn == 1, "Error_diag in from new ({ auto_diag => 1})");
+    like ($warn[0], qr{^# CSV_XS ERROR: 1000 - INI}, "error content");
+    }
+
 is (Text::CSV_XS::error_diag (), "INI - Unknown attribute 'ecs_char'",
 					"Last failure for new () - FAIL");
 is (Text::CSV_XS->error_diag (), "INI - Unknown attribute 'ecs_char'",




More information about the Pkg-perl-cvs-commits mailing list