1
0

- update to 0.81

* Add is_missing ()
   * Doc overhaul
   * Fix Build on OpenVMS (RT#65654, Martin P.J. Zinser)
   * Fix SetDiag () leak (RT#66453, Sven Sch366ling)
   * Implement getline_all () and getaline_hr_all ()
   * Fixed another parsing for eol = \r (RT#61525)
   * Use correct type for STRLEN (HP-UX/PA-RISC/32)
   * More code coverage
   * EOF unreliable when line-end missing at eof
   * Internals now use warn () instead of (void)fprintf (stderr, ...)
     Now the test in t/80_diag also passes on Windows
   * Better parsing for eol = \r and set as such (RT#61525)
   * Workaround for AIX cpp bug (RT#62388, Jan Dubois)
   * 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 ()

OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Text-CSV_XS?expand=0&rev=14
This commit is contained in:
Stephan Kulow 2011-03-31 08:52:47 +00:00 committed by Git OBS Bridge
parent 10f97a9179
commit 76d2dfa66d
4 changed files with 102 additions and 32 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7480a6f24b56a9f658a674c9288e00812a893263b9cdfd2229d9e086f9fa0ba2
size 98060

3
Text-CSV_XS-0.81.tgz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:678ff0d37eec7d8954ba4e37a9ee8be7222bd9312d4e0bdc6890780bc72cf791
size 112866

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Thu Mar 31 08:45:11 UTC 2011 - coolo@novell.com
- update to 0.81
* Add is_missing ()
* Doc overhaul
* Fix Build on OpenVMS (RT#65654, Martin P.J. Zinser)
* Fix SetDiag () leak (RT#66453, Sven Sch366ling)
* Implement getline_all () and getaline_hr_all ()
* Fixed another parsing for eol = \r (RT#61525)
* Use correct type for STRLEN (HP-UX/PA-RISC/32)
* More code coverage
* EOF unreliable when line-end missing at eof
* Internals now use warn () instead of (void)fprintf (stderr, ...)
Now the test in t/80_diag also passes on Windows
* Better parsing for eol = \r and set as such (RT#61525)
* Workaround for AIX cpp bug (RT#62388, Jan Dubois)
* 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 ()
-------------------------------------------------------------------
Wed Dec 1 13:35:44 UTC 2010 - coolo@novell.com

View File

@ -1,5 +1,5 @@
#
# spec file for package perl-Text-CSV_XS (Version 0.73)
# spec file for package perl-Text-CSV_XS (Version 0.81)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -15,24 +15,25 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: perl-Text-CSV_XS
%define cpan_name %( echo %{name} | %{__sed} -e 's,perl-,,' )
Summary: Comma-separated values manipulation routines
Version: 0.73
Version: 0.81
Release: 1
License: Artistic License ..
License: GPL+ or Artistic
%define cpan_name Text-CSV_XS
Summary: comma-separated values manipulation routines
Url: http://search.cpan.org/dist/Text-CSV_XS/
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Text-CSV_XS
Source: %{cpan_name}-%{version}.tar.bz2
#Source: http://www.cpan.org/authors/id/H/HM/HMBRAND/Text-CSV_XS-%{version}.tgz
Source: %{cpan_name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Test::Pod) >= 1.00
BuildRequires: perl(Test::Pod::Coverage)
BuildRequires: perl(Config)
BuildRequires: perl(DynaLoader)
BuildRequires: perl(IO::Handle)
Requires: perl(DynaLoader)
Requires: perl(IO::Handle)
%{perl_requires}
%description
Text::CSV_XS provides facilities for the composition and decomposition of
@ -43,28 +44,75 @@ The module accepts either strings or files as input and can utilize any
user-specified characters as delimiters, separators, and escapes so it is
perhaps better called ASV (anything separated values) rather than just CSV.
Authors:
Embedded newlines
*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 'binary => 1' in the call to
'new'. To cover the widest range of parsing options, you will always
want to set binary.
Alan Citterman <alan@mfgrtl.com> wrote the original Perl module.
Please don't send mail concerning Text::CSV_XS to Alan, as he's not involved
in the C part which is now the main part of the module.
But you still have the problem that you have to pass a correct line to
the 'parse' method, which is more complicated from the usual point of
usage:
Jochen Wiedmann <joe@ispsoft.de> rewrote the encoding and decoding in C by
implementing a simple finite-state machine and added the variable quote,
escape and separator characters, the binary mode and the print and getline
methods. See ChangeLog releases 0.10 through 0.23.
my $csv = Text::CSV_XS->new ({ binary => 1, eol => $/ });
while (<>) { # WRONG!
$csv->parse ($_);
my @fields = $csv->fields ();
H.Merijn Brand <h.m.brand@xs4all.nl> cleaned up the code, added the field
flags methods, wrote the major part of the test suite, completed the
documentation, fixed some RT bugs and added all the allow flags.
See ChangeLog releases 0.25 and on.
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
my $csv = Text::CSV_XS->new ({ binary => 1, eol => $/ });
while (my $row = $csv->getline (*ARGV)) {
my @fields = @$row;
or, more safely in perl 5.6 and up
my $csv = Text::CSV_XS->new ({ binary => 1, eol => $/ });
open my $io, "<", $file or die "$file: $!";
while (my $row = $csv->getline ($io)) {
my @fields = @$row;
Unicode (UTF8)
On parsing (both for 'getline' and 'parse'), if the source is marked
being UTF8, then all fields that are marked binary will also be be
marked UTF8.
For complete control over encoding, please use Text::CSV::Encoded:
use Text::CSV::Encoded;
my $csv = Text::CSV::Encoded->new ({
encoding_in => "iso-8859-1", # the encoding comes into Perl
encoding_out => "cp1252", # the encoding comes out of Perl
});
$csv = Text::CSV::Encoded->new ({ encoding => "utf8" });
# combine () and print () accept *literally* utf8 encoded data
# parse () and getline () return *literally* utf8 encoded data
$csv = Text::CSV::Encoded->new ({ encoding => undef }); # default
# combine () and print () accept UTF8 marked data
# parse () and getline () return UTF8 marked data
On combining ('print' and 'combine'), if any of the combining fields
was marked UTF8, the resulting string will be marked UTF8. Note however
that all fields '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 ]);
%prep
%setup -q -n %{cpan_name}-%{version}
%build
perl Makefile.PL
%{__make} %{?jobs:-j%jobs}
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%{__make} %{?_smp_mflags}
%check
%{__make} test
@ -77,8 +125,8 @@ perl Makefile.PL
%clean
%{__rm} -rf %{buildroot}
%files -f %{name}.files
%defattr(-, root, root)
%files -f %{name}.files
%defattr(644,root,root,755)
%doc ChangeLog README
%changelog