r23743 - in /trunk/libtext-csv-perl: Changes META.yml README debian/changelog debian/compat debian/control debian/copyright debian/rules lib/Text/CSV.pm lib/Text/CSV_PP.pm t/75_hashref.t

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sun Aug 3 10:31:01 UTC 2008


Author: ansgar-guest
Date: Sun Aug  3 10:30:58 2008
New Revision: 23743

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=23743
Log:
* New upstream release.
  + Bump recommended libtext-csv-xs-perl version to 0.52
* Convert debian/copyright to proposed machine-readable format
* Regenerate rules for debhelper 7
* Add myself to Uploaders.

Modified:
    trunk/libtext-csv-perl/Changes
    trunk/libtext-csv-perl/META.yml
    trunk/libtext-csv-perl/README
    trunk/libtext-csv-perl/debian/changelog
    trunk/libtext-csv-perl/debian/compat
    trunk/libtext-csv-perl/debian/control
    trunk/libtext-csv-perl/debian/copyright
    trunk/libtext-csv-perl/debian/rules
    trunk/libtext-csv-perl/lib/Text/CSV.pm
    trunk/libtext-csv-perl/lib/Text/CSV_PP.pm
    trunk/libtext-csv-perl/t/75_hashref.t

Modified: trunk/libtext-csv-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/Changes?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/Changes (original)
+++ trunk/libtext-csv-perl/Changes Sun Aug  3 10:30:58 2008
@@ -1,4 +1,10 @@
 Revision history for Perl extension Text::CSV.
+
+1.07  Fri Aug  1 11:13:06 2008
+	- updated the compatibility for Text::CSV_XS version 0.52
+	    modified column_names()
+	- fixed a parsing bug with quote_char being undef
+	    pointed by Matt (rt#38083)
 
 1.06  Wed Jun 18 14:35:40 2008
 	- updated the compatibility for Text::CSV_XS version 0.51

Modified: trunk/libtext-csv-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/META.yml?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/META.yml (original)
+++ trunk/libtext-csv-perl/META.yml Sun Aug  3 10:30:58 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Text-CSV
-version:             1.06
+version:             1.07
 abstract:            comma-separated values manipulator (using XS or PurePerl)
 license:             ~
 author:              

Modified: trunk/libtext-csv-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/README?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/README (original)
+++ trunk/libtext-csv-perl/README Sun Aug  3 10:30:58 2008
@@ -1,4 +1,4 @@
-Text::CSV version 1.06
+Text::CSV version 1.07
 ========================
 
 comma-separated values manipulator

Modified: trunk/libtext-csv-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/debian/changelog?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/debian/changelog (original)
+++ trunk/libtext-csv-perl/debian/changelog Sun Aug  3 10:30:58 2008
@@ -1,3 +1,13 @@
+libtext-csv-perl (1.07-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+    + Bump recommended libtext-csv-xs-perl version to 0.52
+  * Convert debian/copyright to proposed machine-readable format
+  * Regenerate rules for debhelper 7
+  * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Sun, 03 Aug 2008 12:07:29 +0200
+
 libtext-csv-perl (1.06-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libtext-csv-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/debian/compat?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/debian/compat (original)
+++ trunk/libtext-csv-perl/debian/compat Sun Aug  3 10:30:58 2008
@@ -1,1 +1,1 @@
-5
+7

Modified: trunk/libtext-csv-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/debian/control?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/debian/control (original)
+++ trunk/libtext-csv-perl/debian/control Sun Aug  3 10:30:58 2008
@@ -1,11 +1,11 @@
 Source: libtext-csv-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 5)
+Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: perl (>= 5.6.10-12), libtest-pod-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Vincent Danjean <vdanjean at debian.org>,
- gregor herrmann <gregoa at debian.org>
+ gregor herrmann <gregoa at debian.org>, Ansgar Burchardt <ansgar at 43-1.org>
 Standards-Version: 3.8.0
 Homepage: http://search.cpan.org/dist/Text-CSV/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtext-csv-perl/
@@ -14,7 +14,7 @@
 Package: libtext-csv-perl
 Architecture: all
 Depends: ${perl:Depends}, ${misc:Depends}
-Recommends: libtext-csv-xs-perl (>= 0.51)
+Recommends: libtext-csv-xs-perl (>= 0.52)
 Description: comma-separated values manipulator (using XS or PurePerl)
  Text::CSV provides facilities for the composition and decomposition of
  comma-separated values. An instance of the Text::CSV class can combine

Modified: trunk/libtext-csv-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/debian/copyright?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/debian/copyright (original)
+++ trunk/libtext-csv-perl/debian/copyright Sun Aug  3 10:30:58 2008
@@ -1,20 +1,25 @@
-This is the debian package for the Text-CSV module.
-It was created by Vincent Danjean <vdanjean at debian.org> using dh-make-perl.
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=226
+Upstream-Name: Text-CSV
+Upstream-Maintainer: Makamaka Hannyaharamitu
+Upstream-Source: http://search.cpan.org/dist/Text-CSV/
 
-It was downloaded from http://search.cpan.org/dist/Text-CSV/
+Files: *
+Copyright: © 1997, Alan Citterman. All rights reserved.
+           © 2007-2008 Makamaka Hannyaharamitu. All rights reserved.
+License: GPL-1+ | Artistic
+ This library is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
+ .
+ Perl is distributed under the GNU General Public License, either version 1 or
+ (at your opinion) any later version, and the Artistic License.
+ .
+ On Debian systems, the complete text of the GNU General Public License can be
+ found in /usr/share/common-licenses/GPL and the Artistic License in
+ /usr/share/common-licenses/Artistic.
 
-Copyright (C) 1997 Alan Citterman. All rights reserved.
-Copyright (C) 2007-2008 Makamaka Hannyaharamitu. All rights reserved.
+Files: debian/*
+Copyright: © 2008, Vincent Danjean <vdanjean at debian.org>
+License: GPL-1+ | Artistic
+ This library is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
 
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.8.7 or,
-at your option, any later version of Perl 5 you may have available.
-
-Perl is distributed under either the Artistic licence or the GPL.
-The full text of the GPL is available on Debian systems in
-/usr/share/common-licenses/GPL
-The full text of the Artistic Licence is available on Debian systems in
-/usr/share/common-licenses/Artistic.
-
-The Debian packaging is (C) 2008, Vincent Danjean <vdanjean at debian.org> and
-is licensed under the same terms as the software itself (see above).

Modified: trunk/libtext-csv-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/debian/rules?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/debian/rules (original)
+++ trunk/libtext-csv-perl/debian/rules Sun Aug  3 10:30:58 2008
@@ -1,63 +1,23 @@
 #!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
-PERL   ?= /usr/bin/perl
-PACKAGE = $(shell dh_listpackages)
-TMP     = $(CURDIR)/debian/$(PACKAGE)
 
 build: build-stamp
 build-stamp:
-	dh_testdir
-	# Add commands to compile the package here
-	$(PERL) Makefile.PL INSTALLDIRS=vendor
-	$(MAKE)
-	$(MAKE) test
+	dh build
 	touch $@
 
 clean:
-	dh_testdir
-	dh_testroot
-	dh_clean build-stamp install-stamp
-	# Add commands to clean up after the build process here
-	[ ! -f Makefile ] || $(MAKE) realclean
+	dh $@
 
 install: install-stamp
 install-stamp: build-stamp
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	# Add commands to install the package into $(TMP) here
-	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-	[ ! -d $(TMP)/usr/lib/perl5 ] || \
-		rmdir --ignore-fail-on-non-empty --parents --verbose \
-		$(TMP)/usr/lib/perl5
+	dh install
 	touch $@
 
 binary-arch:
-# We have nothing to do here for an architecture-independent package
 
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_installdocs
-	dh_installchangelogs Changes
-	dh_perl
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
+binary-indep: install
+	dh $@
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+binary: binary-arch binary-indep
+
+.PHONY: binary binary-arch binary-indep install clean build

Modified: trunk/libtext-csv-perl/lib/Text/CSV.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/lib/Text/CSV.pm?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/lib/Text/CSV.pm (original)
+++ trunk/libtext-csv-perl/lib/Text/CSV.pm Sun Aug  3 10:30:58 2008
@@ -5,14 +5,14 @@
 use Carp ();
 
 BEGIN {
-    $Text::CSV::VERSION = '1.06';
+    $Text::CSV::VERSION = '1.07';
     $Text::CSV::DEBUG   = 0;
 }
 
 # if use CSV_XS, requires version
 my $Module_XS  = 'Text::CSV_XS';
 my $Module_PP  = 'Text::CSV_PP';
-my $XS_Version = '0.51';
+my $XS_Version = '0.52';
 
 my $Is_Dynamic = 0;
 
@@ -270,9 +270,9 @@
 
 =head1 VERSION
 
-    1.06
-
-This module is compatible with Text::CSV_XS B<0.51> or later.
+    1.07
+
+This module is compatible with Text::CSV_XS B<0.52> or later.
 
 =head2 BINARY MODE
 
@@ -641,6 +641,16 @@
 
   $csv->column_names ($csv->getline ($io));
 
+C<column_names ()> does B<no> checking on duplicates at all, which might
+lead to unwanted results. Undefined entries will be replaced with the
+string C<"\cAUNDEF\cA">, so
+
+  $csv->column_names (undef, "", "name", "name");
+  $hr = $csv->getline_hr ($io);
+
+Will set C<$hr->{"\cAUNDEF\cA"}> to the 1st field, C<$hr->{""}> to the
+2nd field, and C<$hr->{name}> to the 4th field, discarding the 2rd field.
+
 C<column_names ()> croaks on invalid arguments.
 
 =head2 bind_columns

Modified: trunk/libtext-csv-perl/lib/Text/CSV_PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/lib/Text/CSV_PP.pm?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/lib/Text/CSV_PP.pm (original)
+++ trunk/libtext-csv-perl/lib/Text/CSV_PP.pm Sun Aug  3 10:30:58 2008
@@ -11,7 +11,7 @@
 use vars qw($VERSION);
 use Carp ();
 
-$VERSION = '1.14';
+$VERSION = '1.15';
 
 sub PV  { 0 }
 sub IV  { 1 }
@@ -478,7 +478,12 @@
 
 sub _make_regexp_split_column {
     my ($esc, $quot, $sep) = @_;
-    qr/(
+
+    if ( $quot eq '' ) {
+        return qr/([^\Q$sep\E]*)\Q$sep\E/s;
+    }
+
+   qr/(
         \Q$quot\E
             [^\Q$quot$esc\E]*(?:\Q$esc\E[\Q$quot$esc\E0][^\Q$quot$esc\E]*)*
         \Q$quot\E
@@ -492,6 +497,11 @@
 
 sub _make_regexp_split_column_allow_sp {
     my ($esc, $quot, $sep) = @_;
+
+    if ( $quot eq '' ) {
+        return qr/[\x20\x09]*([^\Q$sep\E]?)[\x20\x09]*\Q$sep\E[\x20\x09]*/s;
+    }
+
     qr/[\x20\x09]*
        (
         \Q$quot\E
@@ -589,25 +599,24 @@
 # column_names
 ################################################################################
 sub column_names {
-    my ( $self, @clumns ) = @_;
-
-    @clumns or return defined $self->{_COLUMN_NAMES} ? @{$self->{_COLUMN_NAMES}} : undef;
-    @clumns == 1 && ! defined $clumns[0] and return $self->{_COLUMN_NAMES} = undef;
-
-    if ( @clumns == 1 && ref $clumns[0] eq "ARRAY" ) {
-        @clumns = @{ $clumns[0] };
-    }
-    elsif ( join "", map { defined $_ ? ref $_ : "UNDEF" } @clumns ) {
+    my ( $self, @columns ) = @_;
+
+    @columns or return defined $self->{_COLUMN_NAMES} ? @{$self->{_COLUMN_NAMES}} : undef;
+    @columns == 1 && ! defined $columns[0] and return $self->{_COLUMN_NAMES} = undef;
+
+    if ( @columns == 1 && ref $columns[0] eq "ARRAY" ) {
+        @columns = @{ $columns[0] };
+    }
+    elsif ( join "", map { defined $_ ? ref $_ : "" } @columns ) {
         $self->SetDiag( 3001 );
     }
 
-    if ( $self->{_is_bound} && @clumns != $self->{_is_bound} ) {
+    if ( $self->{_BOUND_COLUMNS} && @columns != @{$self->{_BOUND_COLUMNS}} ) {
         $self->SetDiag( 3003 );
     }
 
-    $self->{_COLUMN_NAMES} = [ @clumns ];
-
-    @clumns;
+    $self->{_COLUMN_NAMES} = [ map { defined $_ ? $_ : "\cAUNDEF\cA" } @columns ];
+    @{ $self->{_COLUMN_NAMES} };
 }
 ################################################################################
 # bind_columns
@@ -1149,6 +1158,16 @@
 
   $csv->column_names ($csv->getline ($io));
 
+C<column_names ()> does B<no> checking on duplicates at all, which might
+lead to unwanted results. Undefined entries will be replaced with the
+string C<"\cAUNDEF\cA">, so
+
+  $csv->column_names (undef, "", "name", "name");
+  $hr = $csv->getline_hr ($io);
+
+Will set C<$hr->{"\cAUNDEF\cA"}> to the 1st field, C<$hr->{""}> to the
+2nd field, and C<$hr->{name}> to the 4th field, discarding the 2rd field.
+
 C<column_names ()> croaks on invalid arguments.
 
 =head2 bind_columns

Modified: trunk/libtext-csv-perl/t/75_hashref.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-csv-perl/t/75_hashref.t?rev=23743&op=diff
==============================================================================
--- trunk/libtext-csv-perl/t/75_hashref.t (original)
+++ trunk/libtext-csv-perl/t/75_hashref.t Sun Aug  3 10:30:58 2008
@@ -4,7 +4,7 @@
 $^W = 1;
 
 #use Test::More "no_plan";
- use Test::More tests => 62;
+ use Test::More tests => 68;
 
 BEGIN {
     $ENV{PERL_TEXT_CSV} = 0;
@@ -96,8 +96,8 @@
 ok ($csv->bind_columns (@bcr, \$foo),		"bind too many columns");
 ($code, $name, $price, $desc, $foo) = (101 .. 105);
 ok ($csv->getline (*FH),			"fetch less than expected");
-is_deeply ( [ $code, $name, $price, $desc, $foo ],
-	    [ 2, "Drinks", "82.78", "Drinks", 105 ],	"unfetched not reset");
+is_deeply ([ $code, $name, $price, $desc, $foo ],
+	   [ 2, "Drinks", "82.78", "Drinks", 105 ],	"unfetched not reset");
 
 my @foo = (0) x 0x012345;
 ok ($csv->bind_columns (\(@foo)),		"bind a lot of columns");
@@ -112,4 +112,17 @@
 
 close FH;
 
+open  FH, "<_test.csv";
+
+is ($csv->column_names (undef), undef,		"reset column headers");
+is ($csv->bind_columns (undef), undef,		"reset bound columns");
+is_deeply ([ $csv->column_names (undef, "", "name", "name") ],
+	   [ "\cAUNDEF\cA", "", "name", "name" ],	"undefined column header");
+ok ($hr = $csv->getline_hr (*FH),		"getline_hr ()");
+is (ref $hr, "HASH",				"returned a hashref");
+is_deeply ($hr, { "\cAUNDEF\cA" => "code", "" => "name", "name" => "description" },
+    "Discarded 3rd field");
+
+close FH;
+
 unlink "_test.csv";




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