r63153 - in /trunk/libtext-csv-xs-perl: CSV_XS.pm CSV_XS.xs ChangeLog MANIFEST META.yml Makefile.PL debian/changelog debian/copyright debian/patches/ ppport.h t/45_eol.t t/46_eol_si.t t/65_allow.t t/70_rt.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Fri Oct 1 16:15:34 UTC 2010


Author: ansgar-guest
Date: Fri Oct  1 16:14:44 2010
New Revision: 63153

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63153
Log:
* New upstream release.
  + Patch fix-pod-spelling.patch was applied upstream.
* debian/control: Refer to /usr/share/common-licenses/GPL-1;
  refer to "Debian systems" instead of "Debian GNU/Linux systems".

Added:
    trunk/libtext-csv-xs-perl/t/46_eol_si.t
      - copied unchanged from r63151, branches/upstream/libtext-csv-xs-perl/current/t/46_eol_si.t
Removed:
    trunk/libtext-csv-xs-perl/debian/patches/
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/debian/changelog
    trunk/libtext-csv-xs-perl/debian/copyright
    trunk/libtext-csv-xs-perl/ppport.h
    trunk/libtext-csv-xs-perl/t/45_eol.t
    trunk/libtext-csv-xs-perl/t/65_allow.t
    trunk/libtext-csv-xs-perl/t/70_rt.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=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/CSV_XS.pm (original)
+++ trunk/libtext-csv-xs-perl/CSV_XS.pm Fri Oct  1 16:14:44 2010
@@ -30,7 +30,7 @@
 use Carp;
 
 use vars   qw( $VERSION @ISA );
-$VERSION = "0.73";
+$VERSION = "0.74";
 @ISA     = qw( DynaLoader );
 bootstrap Text::CSV_XS $VERSION;
 
@@ -346,7 +346,7 @@
 
 # erro_diag
 #
-#   If (and only if) an error occured, this function returns a code that
+#   If (and only if) an error occurred, this function returns a code that
 #   indicates the reason of failure
 
 sub error_diag
@@ -610,7 +610,7 @@
 
 =head2 Embedded newlines
 
-B<Important Note>: The default behavior is to only accept ascii characters.
+B<Important Note>: The default behavior is to only accept ASCII characters.
 This means that fields can not contain newlines. If your data contains
 newlines embedded in fields, or characters above 0x7e (tilde), or binary data,
 you *must* set C<< binary => 1 >> in the call to C<new ()>.  To cover the widest
@@ -625,7 +625,7 @@
      $csv->parse ($_);
      my @fields = $csv->fields ();
 
-will break, as the while might read broken lines, as that doesn't care
+will break, as the while might read broken lines, as that does not care
 about the quoting. If you need to support embedded newlines, the way to go
 is either
 
@@ -645,9 +645,6 @@
 On parsing (both for C<getline ()> and C<parse ()>), if the source is
 marked being UTF8, then all fields that are marked binary will also be
 be marked UTF8.
-
-On combining (C<print ()> and C<combine ()>), if any of the combining
-fields was marked UTF8, the resulting string will be marked UTF8.
 
 For complete control over encoding, please use Text::CSV::Encoded:
 
@@ -664,6 +661,16 @@
     $csv = Text::CSV::Encoded->new ({ encoding  => undef }); # default
     # combine () and print () accept UTF8 marked data
     # parse () and getline () return UTF8 marked data
+
+On combining (C<print ()> and C<combine ()>), if any of the combining
+fields was marked UTF8, the resulting string will be marked UTF8. Note
+however that all fields C<before> the first field that was marked UTF8
+and contained 8-bit characters that were not upgraded to UTF8, these
+will be bytes in the resulting string too, causing errors. If you pass
+data of different encoding, or you don't know if there is different
+encoding, force it to be upgraded before you pass them on:
+
+    $csv->print ($fh, [ map { utf8::upgrade (my $x = $_); $x } @data ]);
 
 =head1 SPECIFICATION
 
@@ -844,7 +851,7 @@
 
  (1, undef, undef, " ", 2)
 
-Note that this only effects fields that are I<realy> empty, not fields
+Note that this only effects fields that are I<really> empty, not fields
 that are empty after stripping allowed whitespace. YMMV.
 
 =item quote_char
@@ -933,9 +940,9 @@
 
 By default the generated fields are quoted only, if they need to, for
 example, if they contain the separator. If you set this attribute to
-a TRUE value, then all fields will be quoted. This is typically easier
-to handle in external applications. (Poor creatures who aren't using
-Text::CSV_XS. :-)
+a TRUE value, then all defined fields will be quoted. This is typically
+easier to handle in external applications. (Poor creatures who are not
+using Text::CSV_XS. :-)
 
 =item quote_space
 
@@ -981,7 +988,7 @@
 where, the line ending is a very specific "#\r\n", and the sep_char
 is a ^ (caret). None of the fields is quoted, but embedded binary
 data is likely to be present. With the specific line ending, that
-shouldn't be too hard to detect.
+should not be too hard to detect.
 
 By default, Text::CSV_XS' parse function however is instructed to only
 know about "\n" and "\r" to be legal line endings, and so has to deal
@@ -1069,11 +1076,11 @@
  $status = $csv->print (\*FILE, $colref);
 
 as in perl 5.005 and older, the glob C<\*FILE> is not an object, thus it
-doesn't have a print method. The solution is to use an IO::File object or
+does not have a print method. The solution is to use an IO::File object or
 to hide the glob behind an IO::Wrap object. See L<IO::File> and L<IO::Wrap>
 for details.
 
-For performance reasons the print method doesn't create a result string.
+For performance reasons the print method does not create a result string.
 In particular the I<$csv-E<gt>string ()>, I<$csv-E<gt>status ()>,
 I<$csv->fields ()> and I<$csv-E<gt>error_input ()> methods are meaningless
 after executing this method.
@@ -1241,7 +1248,7 @@
 
 For each field, a meta_info field will hold flags that tell something about
 the field returned by the C<fields ()> method or passed to the C<combine ()>
-method. The flags are bitwise-or'd like:
+method. The flags are bit-wise-or'd like:
 
 =over 4
 
@@ -1301,7 +1308,7 @@
  $error_str    = "" . $csv->error_diag ();
  ($cde, $str, $pos) = $csv->error_diag ();
 
-If (and only if) an error occured, this function returns the diagnostics
+If (and only if) an error occurred, this function returns the diagnostics
 of that error.
 
 If called in void context, it will print the internal error code and the
@@ -1317,8 +1324,8 @@
 scalar, a-la $!. It will contain the error code in numeric context, and
 the diagnostics message in string context.
 
-When called as a class method or a direct function call, the error diag
-is that of the last C<new ()> call.
+When called as a class method or a direct function call, the error
+diagnostics is that of the last C<new ()> call.
 
 =head2 SetDiag
 
@@ -1403,7 +1410,7 @@
       }
   close $csv_fh or die "hello.csv: $!";
 
-For more extended examples, see the C<examples/> subdirectory in the
+For more extended examples, see the C<examples/> sub-directory in the
 original distribution or the git repository at
 http://repo.or.cz/w/Text-CSV_XS.git?a=tree;f=examples. The following files
 can be found there:
@@ -1446,7 +1453,7 @@
 
 C<Text::CSV_XS> is not designed to detect the characters used for field
 separation and quoting. The parsing is done using predefined settings. In
-the examples subdirectory, you can find scripts that demonstrate how you
+the examples sub-directory, you can find scripts that demonstrate how you
 can try to detect these characters yourself.
 
 =head2 Microsoft Excel
@@ -1487,12 +1494,12 @@
 Requests for adding means (methods) that combine C<combine ()> and
 C<string ()> in a single call will B<not> be honored. Likewise for
 C<parse ()> and C<fields ()>. Given the trouble with embedded newlines,
-Using C<getline ()> and C<print ()> instead is the prefered way to go.
+Using C<getline ()> and C<print ()> instead is the preferred way to go.
 
 =item Parse the whole file at once
 
 Implement a new methods that enables the parsing of a complete file
-at once, returning a lis of hashes. Possible extension to this could
+at once, returning a list of hashes. Possible extension to this could
 be to enable a column selection on the call:
 
    my @AoH = $csv->parse_file ($filename, { cols => [ 1, 4..8, 12 ]});
@@ -1545,10 +1552,10 @@
 
 Still under construction ...
 
-If an error occured, C<$csv->error_diag ()> can be used to get more information
+If an error occurred, C<$csv->error_diag ()> can be used to get more information
 on the cause of the failure. Note that for speed reasons, the internal value
 is never cleared on success, so using the value returned by C<error_diag ()> in
-normal cases - when no error occured - may cause unexpected results.
+normal cases - when no error occurred - may cause unexpected results.
 
 If the constructor failed, the cause can be found using C<error_diag ()> as a
 class method, like C<Text::CSV_XS->error_diag ()>.
@@ -1558,9 +1565,9 @@
 When set to 1, this will cause a C<warn ()> with the error message, when set
 to 2, it will C<die ()>. C<2012 - EOF> is excluded from C<auto_diag> reports.
 
-Currently errors as described below are available. I've tried to make the error
-itself explanatory enough, but more descriptions will be added. For most of
-these errors, the first three capitals describe the error category:
+Currently errors as described below are available. I have tried to make the
+error itself explanatory enough, but more descriptions will be added. For most
+of these errors, the first three capitals describe the error category:
 
 =over 2
 
@@ -1696,7 +1703,7 @@
 
 =item 3006 "EHR - bind_columns () did not pass enough refs for parsed fields"
 
-=item 3007 "EHR - bind_columns needs refs to writeable scalars"
+=item 3007 "EHR - bind_columns needs refs to writable scalars"
 
 =item 3008 "EHR - unexpected error in bound fields"
 

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=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/CSV_XS.xs (original)
+++ trunk/libtext-csv-xs-perl/CSV_XS.xs Fri Oct  1 16:14:44 2010
@@ -18,8 +18,9 @@
 #define NEED_vload_module
 #include "ppport.h"
 #if (PERL_BCDVERSION <= 0x5005005)
-#  define SvUTF8_on(sv)	/* no-op */
-#  define SvUTF8(sv)	0
+#  define sv_utf8_upgrade(sv)	/* no-op */
+#  define SvUTF8_on(sv)		/* no-op */
+#  define SvUTF8(sv)		0
 #  endif
 #ifndef PERLIO_F_UTF8
 #  define PERLIO_F_UTF8	0x00008000
@@ -68,6 +69,7 @@
 #define CH_CR		'\015'
 #define CH_SPACE	'\040'
 #define CH_DEL		'\177'
+#define CH_EOLX		1215
 
 #define useIO_EOF	0x10
 
@@ -126,6 +128,8 @@
     SV *	tmp;
     int		utf8;
     byte	has_ahead;
+    byte	eolx;
+    int		eol_pos;
     STRLEN	size;
     STRLEN	used;
     char	buffer[BUFFER_SIZE];
@@ -182,7 +186,7 @@
     { 3003, "EHR - bind_columns () and column_names () fields count mismatch"	},
     { 3004, "EHR - bind_columns () only accepts refs to scalars"		},
     { 3006, "EHR - bind_columns () did not pass enough refs for parsed fields"	},
-    { 3007, "EHR - bind_columns needs refs to writeable scalars"		},
+    { 3007, "EHR - bind_columns needs refs to writable scalars"			},
     { 3008, "EHR - unexpected error in bound fields"				},
 
     {    0, "" },
@@ -561,6 +565,18 @@
 	else
 	    csv->is_bound = 0;
 	}
+
+    csv->eolx = 0;
+    if (csv->eol_len) {
+	if (csv->verbatim)
+	    csv->eolx = 1;
+	else
+	for (len = 0; len < csv->eol_len; len++) {
+	    if (csv->eol[len] == CH_NL || csv->eol[len] == CH_CR) continue;
+	    csv->eolx = 1;
+	    break;
+	    }
+	}
     } /* SetupCsv */
 
 #define Print(csv,dst)		cx_Print (aTHX_ csv, dst)
@@ -664,8 +680,10 @@
 		int	e = 0;
 
 		if (!csv->binary && is_csv_binary (c)) {
-		    if (SvUTF8 (*svp))
+		    if (SvUTF8 (*svp)) {
 			csv->binary = 1;
+			csv->utf8   = 1;
+			}
 		    else {
 			SvREFCNT_inc (*svp);
 			unless (hv_store (csv->self, "_ERROR_INPUT", 12, *svp, 0))
@@ -721,12 +739,26 @@
     unless (csv->useIO)
 	return EOF;
 
-    {   int	result;
+    if (csv->tmp && csv->eol_pos >= 0) {
+	csv->eol_pos = -2;
+	sv_setpvn (csv->tmp, csv->eol, csv->eol_len);
+	csv->bptr = SvPV (csv->tmp, csv->size);
+	csv->used = 0;
+	return CH_EOLX;
+	}
+
+    {	int		result, rslen;
+	const char	*rs;
 
 	dSP;
 
 	require_IO_Handle;
 
+	csv->eol_pos = -1;
+	if (csv->eolx) {
+	    rs = SvPOK (PL_rs) || SvPOKp (PL_rs) ? SvPV_const (PL_rs, rslen) : NULL;
+	    sv_setpvn (PL_rs, csv->eol, csv->eol_len);
+	    }
 	PUSHMARK (sp);
 	EXTEND (sp, 1);
 	PUSHs (src);
@@ -734,12 +766,23 @@
 	result = call_sv (m_getline, G_SCALAR | G_METHOD);
 	SPAGAIN;
 	csv->tmp = result ? POPs : NULL;
+	if (csv->eolx) {
+	    if (rs)
+		sv_setpvn (PL_rs, rs, rslen);
+	    else
+		SvPOK_off (PL_rs);
+	    }
 	PUTBACK;
+#if MAINT_DEBUG > 4
+	sv_dump (csv->tmp);
+#endif
 	}
     if (csv->tmp && SvOK (csv->tmp)) {
-	csv->bptr = SvPV (csv->tmp, csv->size);
+	STRLEN tmp_len;
+	csv->bptr = SvPV (csv->tmp, tmp_len);
 	csv->used = 0;
-	if (csv->verbatim && csv->eol_len && csv->size >= csv->eol_len) {
+	csv->size = tmp_len;
+	if (csv->eolx && csv->size >= csv->eol_len) {
 	    int i, match = 1;
 	    for (i = 1; i <= (int)csv->eol_len; i++) {
 		unless (csv->bptr[csv->size - i] == csv->eol[csv->eol_len - i]) {
@@ -748,13 +791,20 @@
 		    }
 		}
 	    if (match) {
+#if MAINT_DEBUG > 4
+		fprintf (stderr, "# EOLX match, size: %d\n", csv->size);
+#endif
 		csv->size -= csv->eol_len;
+		unless (csv->verbatim)
+		    csv->eol_pos = csv->size;
 		csv->bptr[csv->size] = (char)0;
 		SvCUR_set (csv->tmp, csv->size);
+		unless (csv->verbatim || csv->size)
+		    return CH_EOLX;
 		}
 	    }
 	if (SvUTF8 (csv->tmp)) csv->utf8 = 1;
-	if (csv->size) 
+	if (tmp_len)
 	    return ((byte)csv->bptr[csv->used++]);
 	}
     csv->useIO |= useIO_EOF;
@@ -772,19 +822,57 @@
     return FALSE;				\
     }
 
-#define CSV_PUT_SV(c) {				\
+#if MAINT_DEBUG > 4
+#define PUT_RPT       fprintf (stderr, "# CSV_PUT  @ %4d: 0x%02x '%c'\n", __LINE__, c, isprint (c) ? c : '?')
+#define PUT_EOLX_RPT1 fprintf (stderr, "# PUT EOLX @ %4d\n", __LINE__)
+#define PUT_EOLX_RPT2 fprintf (stderr, "# Done putting EOLX\n")
+#define PUSH_RPT      fprintf (stderr, "# AV_PUSHd @ %4d\n", __LINE__); sv_dump (sv)
+#else
+#define PUT_RPT
+#define PUT_EOLX_RPT1
+#define PUT_EOLX_RPT2
+#define PUSH_RPT
+#endif
+#define CSV_PUT_SV1(c) {			\
     len = SvCUR ((sv));				\
     SvGROW ((sv), len + 2);			\
     *SvEND ((sv)) = c;				\
+    PUT_RPT;					\
     SvCUR_set ((sv), len + 1);			\
     }
-
-#define CSV_GET					\
+#define CSV_PUT_SV(c) {				\
+    if (c == CH_EOLX) {				\
+	int x; PUT_EOLX_RPT1;			\
+	if (csv->eol_pos == -2)			\
+	    csv->size = 0;			\
+	for (x = 0; x < csv->eol_len; x++)	\
+	    CSV_PUT_SV1 (csv->eol[x]);		\
+	csv->eol_pos = -1;			\
+	PUT_EOLX_RPT2;				\
+	}					\
+    else					\
+	CSV_PUT_SV1 (c);			\
+    }
+
+#define CSV_GET1				\
     ((csv->used < csv->size)			\
 	? ((byte)csv->bptr[csv->used++])	\
 	: CsvGet (csv, src))
-
-#define AV_PUSH {						\
+#if MAINT_DEBUG > 3
+int CSV_GET_ (csv_t *csv, SV *src, int l)
+{
+    int c;
+    fprintf (stderr, "# 1-CSV_GET @ %4d: (used: %d, size: %d, eol_pos: %d)\n", l, csv->used, csv->size, csv->eol_pos);
+    c = CSV_GET1;
+    fprintf (stderr, "# 2-CSV_GET @ %4d: 0x%02x '%c'\n", l, c, isprint (c) ? c : '?');
+    return (c);
+    } /* CSV_GET_ */
+#define CSV_GET CSV_GET_ (csv, src, __LINE__)
+#else
+#define CSV_GET CSV_GET1
+#endif
+
+#define AV_PUSH { \
     *SvEND (sv) = (char)0;					\
     if (SvCUR (sv) == 0 && (csv->empty_is_undef || (!(f & CSV_FLAGS_QUO) && csv->blank_is_undef))) {\
 	sv_setpvn (sv, NULL, 0);				\
@@ -797,6 +885,7 @@
 	    SvUTF8_on (sv);					\
 	unless (csv->is_bound) av_push (fields, sv);		\
 	}							\
+    PUSH_RPT;							\
     sv = NULL;							\
     if (csv->keep_meta_info)					\
 	av_push (fflags, newSViv (f));				\
@@ -905,12 +994,11 @@
 	    else
 	    if (f & CSV_FLAGS_QUO)
 		CSV_PUT_SV (c)
-	    else {
+	    else
 		AV_PUSH;
-		}
 	    } /* SEP char */
 	else
-	if (c == CH_NL) {
+	if (c == CH_NL || c == CH_EOLX) {
 #if MAINT_DEBUG > 1
 	    fprintf (stderr, "# %d/%d/%02x pos %d = NL\n",
 		waitingForField ? 1 : 0, sv ? 1 : 0, f, spl);
@@ -971,7 +1059,7 @@
 		    }
 
 		if (c2 == CH_NL) {
-		    c = CH_NL;
+		    c = c2;
 		    goto restart;
 		    }
 
@@ -1004,7 +1092,7 @@
 
 		c2 = CSV_GET;
 
-		if (c2 == CH_NL) {
+		if (c2 == CH_NL || c2 == CH_EOLX) {
 		    AV_PUSH;
 		    return TRUE;
 		    }
@@ -1062,7 +1150,7 @@
 			    }
 
 			c3 = CSV_GET;
-			if (c3 == CH_NL) {
+			if (c3 == CH_NL || c3 == CH_EOLX) {
 			    AV_PUSH;
 			    return TRUE;
 			    }
@@ -1108,7 +1196,7 @@
 		if (c2 == csv->quote_char  ||  c2 == csv->sep_char)
 		    CSV_PUT_SV (c2)
 		else
-		if (c2 == CH_NL) {
+		if (c2 == CH_NL || c2 == CH_EOLX) {
 		    AV_PUSH;
 		    return TRUE;
 		    }
@@ -1124,7 +1212,7 @@
 
 			c3 = CSV_GET;
 
-			if (c3 == CH_NL) {
+			if (c3 == CH_NL || c3 == CH_EOLX) {
 			    AV_PUSH;
 			    return TRUE;
 			    }
@@ -1168,7 +1256,7 @@
 		waitingForField = 0;
 	    else
 	    if (f & CSV_FLAGS_QUO) {
-		int	c2 = CSV_GET;
+		int c2 = CSV_GET;
 
 		if (c2 == EOF) {
 		    csv->used--;
@@ -1188,7 +1276,7 @@
 		}
 	    else
 	    if (sv) {
-		int	c2 = CSV_GET;
+		int c2 = CSV_GET;
 
 		if (c2 == EOF) {
 		    csv->used--;
@@ -1363,6 +1451,8 @@
 #if (PERL_BCDVERSION >= 0x5008000)
     PL_ors_sv = ors;
 #endif
+    if (result && !useIO && csv.utf8)
+	sv_utf8_upgrade (io);
     return result;
     } /* xsCombine */
 

Modified: trunk/libtext-csv-xs-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/ChangeLog?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/ChangeLog (original)
+++ trunk/libtext-csv-xs-perl/ChangeLog Fri Oct  1 16:14:44 2010
@@ -1,3 +1,10 @@
+2010-09-29 0.74 - H.Merijn Brand   <h.m.brand at xs4all.nl>
+
+    * Spelling fixes
+    * Real eol support for parsing streams (beyond \n, \r and \r\n)
+    * Clarify doc for always_quote to not quote undef fields
+    * Clarify UTF8 process for print () and combine ()
+
 2010-05-03 0.73 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
     * Improve date conversion in examples/csv2xls

Modified: trunk/libtext-csv-xs-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/MANIFEST?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/MANIFEST (original)
+++ trunk/libtext-csv-xs-perl/MANIFEST Fri Oct  1 16:14:44 2010
@@ -19,6 +19,7 @@
 t/40_misc.t		Binary mode tests
 t/41_null.t		NULL test in combination with line endings
 t/45_eol.t		Embedded EOL
+t/46_eol_si.t		Embedded EOL using scalar io (perlio)
 t/50_utf8.t		Unicode stress tests
 t/51_utf8.t		Unicode IO encoding tests
 t/55_combi.t		Different CSV character combinations

Modified: trunk/libtext-csv-xs-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/META.yml?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/META.yml (original)
+++ trunk/libtext-csv-xs-perl/META.yml Fri Oct  1 16:14:44 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                    Text-CSV_XS
-version:                 0.73
+version:                 0.74
 abstract:                Comma-Separated Values manipulation routines
 license:                 perl
 author:              
@@ -10,7 +10,7 @@
 provides:
     Text::CSV_XS:
         file:            CSV_XS.pm
-        version:         0.73
+        version:         0.74
 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=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/Makefile.PL (original)
+++ trunk/libtext-csv-xs-perl/Makefile.PL Fri Oct  1 16:14:44 2010
@@ -87,7 +87,10 @@
 	'leaktrace:',
 	q{	sandbox/leaktrace $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
 	'',
-	'checkmeta:',
+	'spellcheck:',
+	'	pod-spell-check --aspell',
+	'',
+	'checkmeta:	spellcheck',
 	'	perl sandbox/genPPPort_h.pl',
 	'	perl sandbox/genMETA.pl -c',
 	'',

Modified: trunk/libtext-csv-xs-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/debian/changelog?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/debian/changelog (original)
+++ trunk/libtext-csv-xs-perl/debian/changelog Fri Oct  1 16:14:44 2010
@@ -1,8 +1,15 @@
-libtext-csv-xs-perl (0.73-2) UNRELEASED; urgency=low
-
+libtext-csv-xs-perl (0.74-1) unstable; urgency=low
+
+  [ gregor herrmann ]
   * Set Standards-Version to 3.9.1; replace Conflicts with Breaks.
 
- -- gregor herrmann <gregoa at debian.org>  Sat, 31 Jul 2010 15:38:55 -0400
+  [ Ansgar Burchardt ]
+  * New upstream release.
+    + Patch fix-pod-spelling.patch was applied upstream.
+  * debian/control: Refer to /usr/share/common-licenses/GPL-1;
+    refer to "Debian systems" instead of "Debian GNU/Linux systems".
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Fri, 01 Oct 2010 18:05:49 +0200
 
 libtext-csv-xs-perl (0.73-1) unstable; urgency=low
 

Modified: trunk/libtext-csv-xs-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/debian/copyright?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/debian/copyright (original)
+++ trunk/libtext-csv-xs-perl/debian/copyright Fri Oct  1 16:14:44 2010
@@ -41,8 +41,8 @@
  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'
+ On Debian 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
@@ -50,5 +50,5 @@
  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'
+ On Debian systems, the complete text of version 1 of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.

Modified: trunk/libtext-csv-xs-perl/ppport.h
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/ppport.h?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/ppport.h (original)
+++ trunk/libtext-csv-xs-perl/ppport.h Fri Oct  1 16:14:44 2010
@@ -6,7 +6,7 @@
 
     ppport.h -- Perl/Pollution/Portability Version 3.19
 
-    Automatically created by Devel::PPPort running under perl 5.012000.
+    Automatically created by Devel::PPPort running under perl 5.012002.
 
     Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
     includes in parts/inc/ instead.

Modified: trunk/libtext-csv-xs-perl/t/45_eol.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/t/45_eol.t?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/t/45_eol.t (original)
+++ trunk/libtext-csv-xs-perl/t/45_eol.t Fri Oct  1 16:14:44 2010
@@ -3,7 +3,7 @@
 use strict;
 $^W = 1;
 
-use Test::More tests => 278;
+use Test::More tests => 546;
 
 BEGIN {
     require_ok "Text::CSV_XS";
@@ -42,7 +42,7 @@
 		    "\"$eol\"", " \" $eol \"\n ", "EOL");
 
 		if ($pass == 0) {
-		    ok ($csv->combine (@f),			"combine |$s_eol|");
+		    ok ($csv->combine (@f),		"combine |$s_eol|");
 		    ok (my $str = $csv->string,		"string  |$s_eol|");
 		    my $state = $csv->parse ($str);
 		    ok ($state,				"parse   |$s_eol|");
@@ -153,7 +153,7 @@
 
 ok (1, "EOL undef");
 {   $/ = "\r";
-    ok (my $csv = Text::CSV_XS->new ({eol => undef }), "new csv with eol => undef");
+    ok (my $csv = Text::CSV_XS->new ({ eol => undef }), "new csv with eol => undef");
     open  FH, ">_eol.csv";
     ok ($csv->print (*FH, [1, 2, 3]), "print");
     ok ($csv->print (*FH, [4, 5, 6]), "print");
@@ -168,4 +168,30 @@
     }
 $/ = $def_rs;
 
+foreach my $eol ("!", "!!", "!\n", "!\n!") {
+    (my $s_eol = $eol) =~ s/\n/\\n/g;
+    ok (1, "EOL $s_eol");
+    ok (my $csv = Text::CSV_XS->new ({ eol => $eol }), "new csv with eol => $s_eol");
+    open  FH, ">_eol.csv";
+    ok ($csv->print (*FH, [1, 2, 3]), "print");
+    ok ($csv->print (*FH, [4, 5, 6]), "print");
+    close FH;
+
+    foreach my $rs (undef, "", "\n", $eol, "!", "!\n", "\n!", "!\n!", "\n!\n") {
+	local $/ = $rs;
+	(my $s_rs = defined $rs ? $rs : "-- undef --") =~ s/\n/\\n/g;
+	ok (1, "with RS $s_rs");
+	open FH, "<_eol.csv";
+	ok (my $row = $csv->getline (*FH),	"getline 1");
+	is (scalar @$row, 3,			"# fields");
+	is_deeply ($row, [ 1, 2, 3],		"fields 1");
+	ok (   $row = $csv->getline (*FH),	"getline 2");
+	is (scalar @$row, 3,			"# fields");
+	is_deeply ($row, [ 4, 5, 6],		"fields 2");
+	close FH;
+	}
+    unlink "_eol.csv";
+    }
+$/ = $def_rs;
+
 1;

Modified: trunk/libtext-csv-xs-perl/t/65_allow.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/t/65_allow.t?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/t/65_allow.t (original)
+++ trunk/libtext-csv-xs-perl/t/65_allow.t Fri Oct  1 16:14:44 2010
@@ -337,8 +337,7 @@
 	ok ($row = $csv->getline (*FH),		"#\\r\\n $gc getline");
 	is (@$row, 4,				"#\\r\\n $gc fields");
 	is ($row->[2], "Abe",			"#\\r\\n $gc fld 2");
-	is ($row->[3], $gc ? "Timmerman"
-			   : "Timmerman#",	"#\\r\\n $gc fld 3");
+	is ($row->[3], "Timmerman",		"#\\r\\n $gc fld 3");
 
 	ok ($row = $csv->getline (*FH),		"#\\r\\n $gc parse");
 	is (@$row, 3,				"#\\r\\n $gc fields");

Modified: trunk/libtext-csv-xs-perl/t/70_rt.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-xs-perl/t/70_rt.t?rev=63153&op=diff
==============================================================================
--- trunk/libtext-csv-xs-perl/t/70_rt.t (original)
+++ trunk/libtext-csv-xs-perl/t/70_rt.t Fri Oct  1 16:14:44 2010
@@ -4,7 +4,7 @@
 $^W = 1;
 
 #use Test::More "no_plan";
- use Test::More tests => 380;
+ use Test::More tests => 397;
 
 BEGIN {
     use_ok "Text::CSV_XS", ();
@@ -186,96 +186,129 @@
 {   # http://rt.cpan.org/Ticket/Display.html?id=43927
     # 43927: Is bind_columns broken or am I using it wrong?
     $rt = 43927;
-    SKIP: {
-	open  FH, ">$csv_file";
-	print FH @{$input{$rt}};
-	close FH;
-	my ($c1, $c2);
-	ok (my $csv = Text::CSV_XS->new ({ binary => 1 }), "RT-$rt: $desc{$rt}");
-	ok ($csv->bind_columns (\$c1, \$c2), "bind columns");
-	open  FH, "<$csv_file";
-	ok (my $row = $csv->getline (*FH), "getline () with bound columns");
-	$csv->error_diag ();
-	close FH;
-	unlink $csv_file;
-	is_deeply ($row, [], "should return empty ref");
-	is_deeply ([ $c1, $c2], [ 1, 2 ], "fields ()");
-	}
+    open  FH, ">$csv_file";
+    print FH @{$input{$rt}};
+    close FH;
+    my ($c1, $c2);
+    ok (my $csv = Text::CSV_XS->new ({ binary => 1 }), "RT-$rt: $desc{$rt}");
+    ok ($csv->bind_columns (\$c1, \$c2), "bind columns");
+    open  FH, "<$csv_file";
+    ok (my $row = $csv->getline (*FH), "getline () with bound columns");
+    $csv->error_diag ();
+    close FH;
+    unlink $csv_file;
+    is_deeply ($row, [], "should return empty ref");
+    is_deeply ([ $c1, $c2], [ 1, 2 ], "fields ()");
     }
 
 {   # http://rt.cpan.org/Ticket/Display.html?id=44402
     # 44402 - Unexpected results parsing tab-separated spaces
     $rt = 44402;
-    SKIP: {
-	open  FH, ">$csv_file";
-	my @ws = ("", " ", "  ");
-	foreach my $f1 (@ws) {
-	    foreach my $f2 (@ws) {
-		foreach my $f3 (@ws) {
-		    print FH "$f1\t$f2\t$f3\r\n";
-		    }
+    open  FH, ">$csv_file";
+    my @ws = ("", " ", "  ");
+    foreach my $f1 (@ws) {
+	foreach my $f2 (@ws) {
+	    foreach my $f3 (@ws) {
+		print FH "$f1\t$f2\t$f3\r\n";
 		}
 	    }
-	close FH;
-
-	my $csv;
-	ok ($csv = Text::CSV_XS->new ({
-	    sep_char => "\t",
-	    }), "RT-$rt: $desc{$rt}");
-	open  FH, "<$csv_file";
-	while (my $row = $csv->getline (*FH)) {
-	    ok ($row, "getline $.");
-	    my @row = @$row;
-	    is ($#row, 2, "Got 3 fields");
-	    like ($row[$_], qr{^ *$}, "field $_ with only spaces") for 0..2;
-	    }
-	ok ($csv->eof, "read complete file");
-	close FH;
-
-	ok ($csv = Text::CSV_XS->new ({
-	    sep_char         => "\t",
-	    allow_whitespace => 1,
-	    }), "RT-$rt: $desc{$rt}");
-	open  FH, "<$csv_file";
-	while (my $row = $csv->getline (*FH)) {
-	    ok ($row, "getline $.");
-	    my @row = @$row;
-	    is ($#row, 2, "Got 3 fields");
-	    is ($row[$_], "", "field $_ empty") for 0..2;
-	    }
-	ok ($csv->eof, "read complete file");
-	close FH;
-	unlink $csv_file;
-
-	ok ($csv->parse ("  \t  \t  "), "parse ()");
-	is_deeply ([$csv->fields],["","",""],"3 empty fields");
-	}
+	}
+    close FH;
+
+    my $csv;
+    ok ($csv = Text::CSV_XS->new ({
+	sep_char => "\t",
+	}), "RT-$rt: $desc{$rt}");
+    open  FH, "<$csv_file";
+    while (my $row = $csv->getline (*FH)) {
+	ok ($row, "getline $.");
+	my @row = @$row;
+	is ($#row, 2, "Got 3 fields");
+	like ($row[$_], qr{^ *$}, "field $_ with only spaces") for 0..2;
+	}
+    ok ($csv->eof, "read complete file");
+    close FH;
+
+    ok ($csv = Text::CSV_XS->new ({
+	sep_char         => "\t",
+	allow_whitespace => 1,
+	}), "RT-$rt: $desc{$rt}");
+    open  FH, "<$csv_file";
+    while (my $row = $csv->getline (*FH)) {
+	ok ($row, "getline $.");
+	my @row = @$row;
+	is ($#row, 2, "Got 3 fields");
+	is ($row[$_], "", "field $_ empty") for 0..2;
+	}
+    ok ($csv->eof, "read complete file");
+    close FH;
+    unlink $csv_file;
+
+    ok ($csv->parse ("  \t  \t  "), "parse ()");
+    is_deeply ([$csv->fields],["","",""],"3 empty fields");
     }
 
 {   # Detlev reported an inconsistent difference between _XS and _PP
     $rt = "x1000";
-    SKIP: {
+    open  FH, ">$csv_file";
+    print FH @{$input{$rt}};
+    close FH;
+    my ($c1, $c2);
+    ok (my $csv = Text::CSV_XS->new ({
+	binary      => 1, 
+	eol         => "\n", 
+	sep_char    => "\t",
+	escape_char => undef,
+	quote_char  => undef,
+	binary      => 1 }), "RT-$rt: $desc{$rt}");
+    open  FH, "<$csv_file";
+    for (1 .. 4) {
+	ok (my $row = $csv->getline (*FH), "getline ()");
+	is (scalar @$row, 27, "Line $_: 27 columns");
+	}
+    for (5 .. 6) {
+	ok (my $row = $csv->getline (*FH), "getline ()");
+	is (scalar @$row,  1, "Line $_:  1 column");
+	}
+    $csv->error_diag ();
+    close FH;
+    unlink $csv_file;
+    }
+
+{   # http://rt.cpan.org/Ticket/Display.html?id=58356
+    # 58356 - Incorrect CSV generated if "quote_space => 0"
+    $rt = "58356";
+    ok (my $csv = Text::CSV_XS->new ({
+	binary      => 1,
+	quote_space => 0 }), "RT-$rt: $desc{$rt}");
+    my @list = ("a a", "b,b", "c ,c");
+    ok ($csv->combine (@list), "combine ()");
+    is ($csv->string, q{a a,"b,b","c ,c"}, "string ()");
+    }
+
+{   # http://rt.cpan.org/Ticket/Display.html?id=61525
+    $rt = "61525";
+    foreach my $eol ("\n", "!") {
+	ok (my $csv = Text::CSV_XS->new ({
+	    binary      => 1,
+	    sep_char    => ":",
+	    quote_char  => '"',
+	    escape_char => '"',
+	    eol         => $eol,
+	    auto_diag   => 1,
+	    }), "RT-$rt: $desc{$rt}");
+
 	open  FH, ">$csv_file";
-	print FH @{$input{$rt}};
+	print FH join $eol => qw( "a":"b" "c":"d" "e":"x!y" "!!":"z" );
 	close FH;
-	my ($c1, $c2);
-	ok (my $csv = Text::CSV_XS->new ({
-	    binary      => 1, 
-	    eol         => "\n", 
-	    sep_char    => "\t",
-	    escape_char => undef,
-	    quote_char  => undef,
-	    binary => 1 }), "RT-$rt: $desc{$rt}");
+
 	open  FH, "<$csv_file";
-	for (1 .. 4) {
-	    ok (my $row = $csv->getline (*FH), "getline ()");
-	    is (scalar @$row, 27, "Line $_: 27 columns");
-	    }
-	for (5 .. 6) {
-	    ok (my $row = $csv->getline (*FH), "getline ()");
-	    is (scalar @$row,  1, "Line $_:  1 column");
-	    }
-	$csv->error_diag ();
+	is_deeply ($csv->getline (*FH), [ "a",  "b"   ], "Pair 1");
+	is_deeply ($csv->getline (*FH), [ "c",  "d"   ], "Pair 2");
+	is_deeply ($csv->getline (*FH), [ "e",  "x!y" ], "Pair 3");
+	is_deeply ($csv->getline (*FH), [ "!!", "z"   ], "Pair 4");
+	is ($csv->getline (*FH), undef, "no more pairs");
+	ok ($csv->eof, "EOF");
 	close FH;
 	unlink $csv_file;
 	}
@@ -323,3 +356,5 @@
 B:035_03_	fission, one	horns	@p 03-035.bmp	@p 03-035.bmp			obsolete Heising explanation for form without the horizontal line: Variante von "horns", die erscheint, wenn darunter keine horizontale Linie steht\x{A}\x{A}Found through e_sect2.pdf as U+F7EA (??,) but won't display	\x{A}		1	:c/b01:!1	!	11	!10			:b/b01:0						B:035_03_		3	
 
 --------------090302050909040309030109--
+«58356» - Incorrect CSV generated if "quote_space => 0"
+«61525» - eol not working for values other than "\n"?




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