Module-Packaged-0.86/0000755000175100001440000000000010475312777014473 5ustar acmeusers00000000000000Module-Packaged-0.86/t/0000755000175100001440000000000010475312777014736 5ustar acmeusers00000000000000Module-Packaged-0.86/t/pod_coverage.t0000644000175100001440000000025410475312777017561 0ustar acmeusers00000000000000#!perl -T use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); Module-Packaged-0.86/t/simple.t0000644000175100001440000000146510475312777016422 0ustar acmeusers00000000000000#!/usr/bin/perl -w use strict; use Test::More tests => 4; use_ok('Module::Packaged'); warn "\n# These tests take a while to run as we need to mirror a large\n"; warn "# file from the web. Please be patient.\n"; my $p = Module::Packaged->new(); my $dists = $p->check('Acme-Buffy'); is_deeply($dists, { cpan => '1.3', }, 'Acme-Buffy'); $dists = $p->check('Archive-Tar'); is_deeply($dists, { cpan => '1.30', debian => '1.30', fedora => '1.08', freebsd => '1.30', gentoo => '1.29', mandrake => '1.23', openbsd => '1.08', suse => '1.24', }, 'Archive-Tar'); $dists = $p->check('DBI'); is_deeply($dists, { cpan => '1.52', debian => '1.52', fedora => '1.40', freebsd => '1.52', gentoo => '1.50', mandrake => '1.47', openbsd => '1.43', suse => '1.50', }, 'DBI'); Module-Packaged-0.86/t/pod.t0000644000175100001440000000022010475312777015677 0ustar acmeusers00000000000000#!perl -T use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD: $@" if $@; all_pod_files_ok(); Module-Packaged-0.86/CHANGES0000644000175100001440000000465310475312777015476 0ustar acmeusers00000000000000Revision history for Perl module Module::Packaged: 0.86 Wed Aug 30 14:36:40 BST 2006 - fix the path we were fetching SUSE data from - updated the test (prodded by jerakeen) 0.85 Tue Jan 31 09:38:02 GMT 2006 - fix the path we were fetching Mandriva data from 0.84 Fri Aug 5 19:04:55 PDT 2005 - rewrite the generator to use App::Cache and update Mandriva name - fix Debian perl-tk misreporting (patch by Andreas Koenig) 0.83 Thu Aug 4 09:30:04 PDT 2005 - 0.82 wasn't quite uploaded to CPAN, pesky wireless 0.82 Thu Aug 4 09:16:13 PDT 2005 - updated the tests (thanks Andreas) 0.81 Mon Jul 4 23:24:32 BST 2005 - we now cache the data for an hour using App::Cache - added a pod coverage test - updated the tests 0.80 Sat Mar 26 09:33:04 CST 2005 - fixed tiny typo in pod (spotted by mcummings) - updated the tests - seperated into a generator and a client (so now faster for you!) 0.79 Sun Feb 6 17:42:47 GMT 2005 - include Mandrake contrib (oops) 0.78 Sat Feb 5 17:20:48 GMT 2005 - updated the tests - fixed brokenness with Fedora, Mandrake, SUSE 0.77 Thu Sep 23 11:45:51 BST 2004 - slightly more documentation - renamed private methods to start with underscore 0.76 Tue Aug 24 16:14:25 BST 2004 - removed dependency on Cache::Cache - updated the tests (maybe I should fix the test suite, eh?) 0.74 Thu Apr 22 17:17:21 BST 2004 - resupport Gentoo (thanks to patch from Michael Cummings) - remove Perl6::Slurp dependency (sorry, too many deps) - make it work with Parse::CPAN::Packages 2.20 (oops) - added support for Fedora, Mandrake and SUSE - updated the tests 0.73 Thu Mar 4 09:33:38 GMT 2004 - use Perl6::Slurp instead of File::Slurp - remove Gentoo support (the URL we were using is now a 404 and packages.gentoo.org isn't easy to scrape) - report OpenBSD packages in 3.4 (3.2 is old now) - updated the tests - now use Parse::CPAN::Packages 0.72 Wed Jan 7 16:25:31 GMT 2004 - a new version of Archive::Tar came out, update the tests 0.71 Mon Jan 5 16:14:32 GMT 2004 - a new version of DBI came out, update the tests 0.67 Tue Nov 18 22:16:11 GMT 2003 - added OpenBSD support (thanks to Richard Clamp, again) 0.54 Mon Nov 17 22:42:42 GMT 2003 - added Debian support (thanks to Richard Clamp) - reworked caching 0.41 Mon Nov 17 17:55:35 GMT 2003 - support FreeBSD too (thanks to Richard Clamp) - added NINJA support 0.34 Thu Nov 13 19:53:01 GMT 2003 - initial release Module-Packaged-0.86/NINJA0000644000175100001440000000020710475312777015254 0ustar acmeusers00000000000000--- #YAML:1.0 attributes: charisma: 0.33 constitution: 0.47 dexterity: 1.00 intelligence: 0.27 strength: 0.93 wisdom: 0.87 Module-Packaged-0.86/META.yml0000644000175100001440000000033310475312777015743 0ustar acmeusers00000000000000--- #YAML:1.0 name: Module-Packaged version: 0.86 author: - Leon Brocard, leon@astray.com abstract: Report upon packages of CPAN distributions license: perl generated_by: Module::Build version 0.2612, without YAML.pm Module-Packaged-0.86/lib/0000755000175100001440000000000010475312777015241 5ustar acmeusers00000000000000Module-Packaged-0.86/lib/Module/0000755000175100001440000000000010475312777016466 5ustar acmeusers00000000000000Module-Packaged-0.86/lib/Module/Packaged/0000755000175100001440000000000010475312777020165 5ustar acmeusers00000000000000Module-Packaged-0.86/lib/Module/Packaged/Generate.pm0000644000175100001440000001650110475312777022260 0ustar acmeusers00000000000000package Module::Packaged::Generate; use strict; use App::Cache; use IO::File; use Compress::Zlib; use IO::String; use IO::Zlib; use File::Spec::Functions qw(catdir catfile tmpdir); use LWP::Simple qw(mirror); use Parse::CPAN::Packages; use Parse::Debian::Packages; use Sort::Versions; use Storable qw(store retrieve); use base 'Class::Accessor::Chained::Fast'; __PACKAGE__->mk_accessors(qw(cache data)); sub new { my $class = shift; my $self = {}; bless $self, $class; $self->cache(App::Cache->new({ ttl => 60 * 60 })); $self->{data} = $self->cache->get_code( "data", sub { $self->_fetch_cpan; $self->_fetch_debian; $self->_fetch_fedora; $self->_fetch_freebsd; $self->_fetch_gentoo; $self->_fetch_mandrake; $self->_fetch_openbsd; $self->_fetch_suse; $self->{data}; } ); return $self; } sub _fetch_cpan { my $self = shift; my $details = $self->cache->get_url( "http://www.cpan.org/modules/02packages.details.txt.gz", "02packages.gz"); $details = Compress::Zlib::memGunzip($details); my $p = Parse::CPAN::Packages->new($details); foreach my $dist ($p->latest_distributions) { $self->{data}->{ $dist->dist }->{cpan} = $dist->version; } } sub _fetch_gentoo { my $self = shift; my $file = $self->cache->get_url("http://www.gentoo.org/dyn/gentoo_pkglist_x86.txt", "gentoo.html"); $file =~ s{\n}{}g; my @dists = keys %{ $self->{data} }; foreach my $line (split "\n", $file) { next unless ($line =~ m/dev-perl/); my $dist; $line =~ s/\.ebuild//g; my ($package, $version, $trash) = split(' ', $line); next unless $package; # Let's try to find a cpan dist that matches the package name if (exists $self->{data}->{$package}) { $dist = $package; } else { foreach my $d (@dists) { if (lc $d eq lc $package) { $dist = $d; last; } } } if ($dist) { $self->{data}->{$dist}->{gentoo} = $version; } else { # I should probably care about these and fix them # warn "Could not find $package: $version\n"; } } } sub _fetch_fedora { my $self = shift; my $file = $self->cache->get_url("http://fedora.redhat.com/docs/package-list/fc2/", "fedora.html"); foreach my $line (split "\n", $file) { next unless $line =~ /^perl-/; my ($dist, $version) = $line =~ m{perl-(.*?)(.*?)}; # only populate if CPAN already has $self->{data}{$dist}{fedora} = $version if $self->{data}{$dist}; } } sub _fetch_suse { my $self = shift; my $file = $self->cache->get_url( "http://www.novell.com/products/linuxpackages/suselinux/index_all.html", "suse.html" ); foreach my $line (split "\n", $file) { # perl-DBI 1.43 (The Perl Database Interface) my ($dist, $version) = $line =~ m{">perl-(.*?) (.*?) }; next unless $dist; # only populate if CPAN already has $self->{data}{$dist}{suse} = $version if $self->{data}{$dist}; } } sub _fetch_mandrake { my $self = shift; my $file1 = $self->cache->get_url( "http://distro.ibiblio.org/pub/linux/distributions/mandriva/MandrivaLinux/official/10.2/i586/media/media_info/synthesis.hdlist_main.cz", "mandrake1.html" ); my $file2 = $self->cache->get_url( "http://distro.ibiblio.org/pub/linux/distributions/mandriva/MandrivaLinux/official/10.2/i586/media/media_info/synthesis.hdlist_contrib.cz", "mandrake2.html" ); foreach my $file ($file1, $file2) { $file = Compress::Zlib::memGunzip($file); foreach my $line (split / /, $file) { # @info@perl-DBI-1.43-2mdk.i586@0@1371700@Development/Perl next unless my ($dist, $version) = $line =~ m{\@info\@perl-(.*)-(.*?)-\d+mdk}; # only populate if CPAN already has $self->{data}{$dist}{mandrake} = $version if $self->{data}{$dist}; } } } sub _fetch_freebsd { my $self = shift; my $file = $self->cache->get_url("http://www.freebsd.org/ports/perl5.html", "freebsd.html"); #
p5-DBI-1.37
for my $package ($file =~ m/A NAME="p5-(.*?)"/g) { my ($dist, $version) = $package =~ /^(.*?)-(\d.*)$/ or next; # tidy up the oddness FreeBSD versions $version =~ s/_\d$//; # only populate if CPAN already has $self->{data}{$dist}{freebsd} = $version if $self->{data}{$dist}; } } sub _fetch_debian { my $self = shift; my %dists = map { lc $_ => $_ } keys %{ $self->{data} }; for my $dist (qw( stable testing unstable )) { my $data = $self->cache->get_url( "http://ftp.debian.org/dists/$dist/main/binary-i386/Packages.gz", "debian-$dist-Packages.gz"); $data = Compress::Zlib::memGunzip($data); my $fh = IO::String->new($data); my $debthing = Parse::Debian::Packages->new($fh); while (my %package = $debthing->next) { next unless $package{Package} =~ /^lib(.*?)-perl$/ || $package{Package} =~ /^perl-(tk)$/; my $dist = $dists{$1} or next; # don't care about the debian version my ($version) = $package{Version} =~ /^(.*?)-/; $self->{data}{$dist}{debian} = $version if $self->{data}{$dist}; } } } sub _fetch_openbsd { my $self = shift; my $file = $self->cache->get_url("http://www.openbsd.org/3.6_packages/i386.html", "openbsd.html"); for my $package ($file =~ m/href=i386\/p5-(.*?)\.tgz-long/g) { my ($dist, $version) = $package =~ /^(.*?)-(\d.*)$/ or next; # only populate if CPAN already has $self->{data}{$dist}{openbsd} = $version if $self->{data}{$dist}; } } sub check { my ($self, $dist) = @_; return $self->{data}->{$dist}; } 1; __END__ =head1 NAME Module::Packaged - Report upon packages of CPAN distributions =head1 SYNOPSIS use Module::Packaged; my $p = Module::Packaged->new(); my $dists = $p->check('Archive-Tar'); # $dists is now: # { # cpan => '1.08', # debian => '1.03', # fedora => '0.22', # freebsd => '1.07', # gentoo => '1.05', # openbsd => '0.22', # suse => '0.23', # } # meaning that Archive-Tar is at version 1.08 on CPAN but only at # version 1.07 on FreeBSD, version 1.05 on Gentoo, version 1.03 on # Debian, version 0.23 on SUSE and version 0.22 on OpenBSD =head1 DESCRIPTION CPAN consists of distributions. However, CPAN is not an isolated system - distributions are also packaged in other places, such as for operating systems. This module reports whether CPAN distributions are packaged for various operating systems, and which version they have. Note: only CPAN, Debian, Fedora (Core 2), FreeBSD, Gentoo, Mandriva (10.1), OpenBSD (3.6) and SUSE (9.2) are currently supported. I want to support everything else. Patches are welcome. =head1 METHODS =head2 new() The new() method is a constructor: my $p = Module::Packaged->new(); =head2 check() The check() method returns a hash reference. The keys are various distributions, the values the version number included: my $dists = $p->check('Archive-Tar'); =head1 COPYRIGHT Copyright (c) 2003-5 Leon Brocard. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Leon Brocard, leon@astray.com Module-Packaged-0.86/lib/Module/Packaged.pm0000644000175100001440000000413210475312777020523 0ustar acmeusers00000000000000package Module::Packaged; use strict; use App::Cache; use Compress::Zlib; use LWP::Simple; use Storable qw(thaw); use vars qw($VERSION); $VERSION = '0.86'; sub new { my $class = shift; my $self = {}; bless $self, $class; my $cache = App::Cache->new({ ttl => 60 * 60 }); my $data = $cache->get_url('http://www.astray.com/tmp/module_packaged.gz'); $self->{data} = thaw(uncompress($data)); return $self; } sub check { my ($self, $dist) = @_; return $self->{data}->{$dist}; } 1; __END__ =head1 NAME Module::Packaged - Report upon packages of CPAN distributions =head1 SYNOPSIS use Module::Packaged; my $p = Module::Packaged->new(); my $dists = $p->check('Archive-Tar'); # $dists is now: # { # cpan => '1.08', # debian => '1.03', # fedora => '0.22', # freebsd => '1.07', # gentoo => '1.05', # openbsd => '0.22', # suse => '0.23', # } # meaning that Archive-Tar is at version 1.08 on CPAN but only at # version 1.07 on FreeBSD, version 1.05 on Gentoo, version 1.03 on # Debian, version 0.23 on SUSE and version 0.22 on OpenBSD =head1 DESCRIPTION CPAN consists of distributions. However, CPAN is not an isolated system - distributions are also packaged in other places, such as for operating systems. This module reports whether CPAN distributions are packaged for various operating systems, and which version they have. Only CPAN, Debian, Fedora (Core 2), FreeBSD, Gentoo, Mandriva (10.1), OpenBSD (3.6) and SUSE (9.2) are currently supported. I want to support everything else. Patches are welcome. The data is fetched from the net and cached for an hour. =head1 METHODS =head2 new() The new() method is a constructor: my $p = Module::Packaged->new(); =head2 check() The check() method returns a hash reference. The keys are various distributions, the values the version number included: my $dists = $p->check('Archive-Tar'); =head1 COPYRIGHT Copyright (c) 2003-5 Leon Brocard. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Leon Brocard, leon@astray.com Module-Packaged-0.86/MANIFEST0000644000175100001440000000025410475312777015625 0ustar acmeusers00000000000000Build.PL CHANGES lib/Module/Packaged.pm lib/Module/Packaged/Generate.pm Makefile.PL MANIFEST This list of files META.yml NINJA README t/pod.t t/pod_coverage.t t/simple.t Module-Packaged-0.86/README0000644000175100001440000000325210475312777015355 0ustar acmeusers00000000000000NAME Module::Packaged - Report upon packages of CPAN distributions SYNOPSIS use Module::Packaged; my $p = Module::Packaged->new(); my $dists = $p->check('Archive-Tar'); # $dists is now: # { # cpan => '1.08', # debian => '1.03', # fedora => '0.22', # freebsd => '1.07', # gentoo => '1.05', # openbsd => '0.22', # suse => '0.23', # } # meaning that Archive-Tar is at version 1.08 on CPAN but only at # version 1.07 on FreeBSD, version 1.05 on Gentoo, version 1.03 on # Debian, version 0.23 on SUSE and version 0.22 on OpenBSD DESCRIPTION CPAN consists of distributions. However, CPAN is not an isolated system - distributions are also packaged in other places, such as for operating systems. This module reports whether CPAN distributions are packaged for various operating systems, and which version they have. Only CPAN, Debian, Fedora (Core 2), FreeBSD, Gentoo, Mandrake (10.1), OpenBSD (3.6) and SUSE (9.2) are currently supported. I want to support everything else. Patches are welcome. The data is fetched from the net and cached for an hour. METHODS new() The new() method is a constructor: my $p = Module::Packaged->new(); check() The check() method returns a hash reference. The keys are various distributions, the values the version number included: my $dists = $p->check('Archive-Tar'); COPYRIGHT Copyright (c) 2003-5 Leon Brocard. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR Leon Brocard, leon@astray.com Module-Packaged-0.86/Build.PL0000644000175100001440000000132610475312777015771 0ustar acmeusers00000000000000use strict; use Module::Build; my $build = Module::Build->new( create_makefile_pl => 'traditional', license => 'perl', module_name => 'Module::Packaged', requires => { 'App::Cache' => '0', 'Compress::Zlib' => '0', 'Class::Accessor::Chained::Fast' => '0', 'Storable' => '0', 'IO::File' => '1.08', 'IO::String' => '0', 'IO::Zlib' => '1.01', 'LWP::Simple' => '1.38', 'Sort::Versions' => '1.50', 'Test::More' => '0.47', 'Parse::CPAN::Packages' => '2.20', 'Parse::Debian::Packages' => '0.01', }, ); $build->create_build_script; Module-Packaged-0.86/Makefile.PL0000644000175100001440000000172610475312777016453 0ustar acmeusers00000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.03 use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'Module::Packaged', 'VERSION_FROM' => 'lib/Module/Packaged.pm', 'PREREQ_PM' => { 'App::Cache' => '0', 'Class::Accessor::Chained::Fast' => '0', 'Compress::Zlib' => '0', 'IO::File' => '1.08', 'IO::String' => '0', 'IO::Zlib' => '1.01', 'LWP::Simple' => '1.38', 'Parse::CPAN::Packages' => '2.20', 'Parse::Debian::Packages' => '0.01', 'Sort::Versions' => '1.50', 'Storable' => '0', 'Test::More' => '0.47' }, 'INSTALLDIRS' => 'site', 'PL_FILES' => {} ) ;