r66546 - in /branches/upstream/libparse-cpan-packages-perl/current: CHANGES META.yml lib/Parse/CPAN/Packages.pm
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue Dec 28 03:45:40 UTC 2010
Author: jawnsy-guest
Date: Tue Dec 28 03:45:29 2010
New Revision: 66546
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66546
Log:
[svn-upgrade] new version libparse-cpan-packages-perl (2.33)
Modified:
branches/upstream/libparse-cpan-packages-perl/current/CHANGES
branches/upstream/libparse-cpan-packages-perl/current/META.yml
branches/upstream/libparse-cpan-packages-perl/current/lib/Parse/CPAN/Packages.pm
Modified: branches/upstream/libparse-cpan-packages-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-packages-perl/current/CHANGES?rev=66546&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-packages-perl/current/CHANGES (original)
+++ branches/upstream/libparse-cpan-packages-perl/current/CHANGES Tue Dec 28 03:45:29 2010
@@ -1,4 +1,13 @@
CHANGES file for Parse::CPAN::Packages
+
+2.33 Sun Dec 27 10:42:59 GMT+2 2010
+ - updated documentation
+ - explanation on how to use local cpan cache ( thanks to Slaven ReziÄ <SREZIC at cpan.org> )
+ - spelling and package name fixes ( Phillip Moore <w.phillip.moore at gmail.com> )
+ - improved memory use a bit by eleminating temp variable ( thanks to Chris 'BinGOs' Williams <chris at bingosnet.co.uk> )
+
+2.32 Sun Dec 26 14:02:59 GMT+2 2010
+ - better windows compatibility ( thanks to Vincent Pit <perl at profvince.com> )
2.31 Thu Apr 23 11:55:59 BST 2009
- use BUILDARGS and BUILD instead of having our own constructor
@@ -16,7 +25,7 @@
(patch by Mark Fowler)
2.28 Tue Aug 12 08:02:22 BST 2008
- - stop version.pm warnings
+ - stop version.pm warnings
2.27 Sun Dec 2 14:50:14 GMT 2007
- fix typo in _ensure_latest_distribution (patch by Kenichi Ishigaki)
Modified: branches/upstream/libparse-cpan-packages-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-packages-perl/current/META.yml?rev=66546&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-packages-perl/current/META.yml (original)
+++ branches/upstream/libparse-cpan-packages-perl/current/META.yml Tue Dec 28 03:45:29 2010
@@ -1,18 +1,26 @@
--- #YAML:1.0
-name: Parse-CPAN-Packages
-version: 2.31
-abstract: Parse 02packages.details.txt.gz
-license: perl
-author:
+name: Parse-CPAN-Packages
+version: 2.33
+abstract: Parse 02packages.details.txt.gz
+author:
- Leon Brocard <acme at astray.com>
-generated_by: ExtUtils::MakeMaker version 6.44
-distribution_type: module
-requires:
- Compress::Zlib: 0
- CPAN::DistnameInfo: 0
- Moose: 0
- Test::More: 0
- version: 0
+license: perl
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Compress::Zlib: 0
+ CPAN::DistnameInfo: 0
+ Moose: 0
+ Test::More: 0
+ version: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libparse-cpan-packages-perl/current/lib/Parse/CPAN/Packages.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-packages-perl/current/lib/Parse/CPAN/Packages.pm?rev=66546&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-packages-perl/current/lib/Parse/CPAN/Packages.pm (original)
+++ branches/upstream/libparse-cpan-packages-perl/current/lib/Parse/CPAN/Packages.pm Tue Dec 28 03:45:29 2010
@@ -5,7 +5,7 @@
use Parse::CPAN::Packages::Distribution;
use Parse::CPAN::Packages::Package;
use version;
-our $VERSION = '2.31';
+our $VERSION = '2.33';
has 'filename' => ( is => 'rw', isa => 'Str' );
has 'details' => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
@@ -39,6 +39,7 @@
return $filename;
} elsif ( $filename =~ /\.gz/ ) {
open( IN, $filename ) || die "Failed to read $filename: $!";
+ binmode *IN;
my $data = join '', <IN>;
close(IN);
return Compress::Zlib::memGunzip($data);
@@ -46,8 +47,10 @@
return Compress::Zlib::memGunzip($filename);
} else {
open( IN, $filename ) || die "Failed to read $filename: $!";
- return join '', <IN>;
+ binmode *IN;
+ my $data = join '', <IN>;
close(IN);
+ return $data;
}
}
@@ -61,10 +64,9 @@
sub parse {
my ( $self, $filename ) = @_;
- my $details = $self->_slurp_details($filename);
# read the preamble
- my @details = split "\n", $details;
+ my @details = split "\n", $self->_slurp_details($filename);
while (@details) {
local $_ = shift @details;
last if /^\s*$/;
@@ -309,12 +311,21 @@
my $data = get("http://www.cpan.org/modules/02packages.details.txt.gz");
my $p = Parse::CPAN::Packages->new($data);
+If you have a configured L<CPAN>, then there's usually already a
+cached file available:
+
+ use CPAN;
+ $CPAN::Be_Silent = 1;
+ CPAN::HandleConfig->load;
+ my $file = $CPAN::Config->{keep_source_where} . "/modules/02packages.details.txt.gz";
+ my $p = Parse::CPAN::Packages->new($file);
+
=item package($packagename)
Returns a C<Parse::CPAN::Packages::Package> that represents the
named package.
- my $p = Parse::CPAN::Distribution->new($gzfilename);
+ my $p = Parse::CPAN::Packages->new($gzfilename);
my $package = $p->package("Acme::Colour");
=item packages()
@@ -324,20 +335,20 @@
=item package_count()
-Returns the numebr of packages stored.
+Returns the number of packages stored.
=item distribution($filename)
-Returns a B<Parse::CPAN::Distribution> that represents the
-filename passed:
-
- my $p = Parse::CPAN::Distribution->new($gzfilename);
+Returns a B<Parse::CPAN::Packages::Distribution> object that
+represents the filename passed:
+
+ my $p = Parse::CPAN::Packages->new($gzfilename);
my $dist = $p->distribution('L/LB/LBROCARD/Acme-Colour-1.00.tar.gz');
=item distributions()
-Returns a list of B<Parse::CPAN::Distribution> objects representing
-all the known distributions.
+Returns a list of B<Parse::CPAN::Packages::Distribution> objects
+representing all the known distributions.
=item distribution_count()
@@ -345,18 +356,19 @@
=item latest_distribution($distname)
-Returns the C<Parse::CPAN::Distribution> that represents the latest
-distribution for the named disribution passed, that is to say it
-returns the distribution that has the highest version number (as
-determined by version.pm or number comparison if that fails):
-
- my $p = Parse::CPAN::Distribution->new($gzfilename);
+Returns the C<Parse::CPAN::Packages::Distribution> object that
+represents the latest distribution for the named disribution passed,
+that is to say it returns the distribution that has the highest
+version number (as determined by version.pm or number comparison if
+that fails):
+
+ my $p = Parse::CPAN::Packages->new($gzfilename);
my $dist = $p->distribution('Acme-Color');
=item latest_distrbutions()
-Returns a list of B<Parse::CPAN::Distribution> objects representing
-all the latest distributions.
+Returns a list of B<Parse::CPAN::Packages::Distribution> objects
+representing all the latest distributions.
=item latest_distribution_count()
More information about the Pkg-perl-cvs-commits
mailing list