The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CPAN::Mini::Tested - Create a CPAN mirror using modules with passing test reports

SYNOPSYS

  use CPAN::Mini::Tested;

  CPAN::Mini::Tested->update_mirror(
      remote => "http://cpan.mirrors.comintern.su",
      local  => "/usr/share/mirrors/cpan",
      trace  => 1
  );

DESCRIPTION

This module is a subclass of CPAN::Mini which checks a CPAN Testers database for passing tests of that distribution on your platform. Distributions will only be downloaded if there have passing test reports.

The major differences are that it will download the testers.db file from the CPAN Testers web site when updating indices, and it will check if a distribution has passed tests in the specified platform before applying other filtering rules to it.

The following additional options are supported:

test_db_exceptions

A Regexp or array of Regexps (or Regexp strings) of module paths that will be included in the mirror even if there are no PASS reports for them.

If it is a code reference, then it refers to a subroutine which takes the module path as an argument and returns true if it is an exception.

Note that if these modules are already in the exclusion list used by CPAN::Mini, then they will not be included.

test_db_age

The maximum age of the local copy of the testers database, in days. The default is 1.

When set to 0, or when the force option is set, the latest copy of the database will be downloaded no matter how old it is.

When set to -1, a new copy will never be downloaded.

Note that the testers database can be quite large (over 15MB).

test_db_src

Where to download the latest copy of the CPAN Testers database. Defaults to http://devel.cpantesters.org/cpanstats.db, however please note this file is no longer updated since April 2013.

test_db_file

The location of the local copy of the CPAN Testers database. Defaults to the root directory of local.

test_db_os

The platform that tests are expected to pass. Defaults to the current platform $Config{osname}.

If this is set to a list of platforms (an array reference), then it expects tests on any one of those platforms to pass. This is useful for maintaining a mirror that supports multiple platforms, or in cases where there tests are similar platforms are acceptable.

test_db_conn

Connection parameters for DBI. In most cases these can be ignored.

test_db_cache_expiry

The number of seconds it caches database queries. Defaults to 300.

CPAN::Mini will check the filters multiple times for distributions that contain multiple modules. (Older versions of CPAN::Mini will check the filters multiple times per module.) Caching the results improves performance, but we need to maintain the results for very long, nor do we want all of the results to use memory.

Subclassed Methods

The following methods are subclasses from CPAN::Mini:

_filter_module

In addition to noting if a module is in the exclusion list, it also notes if it has not passed any tests.

mirror_indices

Downloads the latest cpanstats.db database file (if needed) and connects to the database before it begins downloading indices.

file_allowed

Also notes if the file is the cpanstats.db databse file.

clean_unmirrored

Disconnects from the database before cleaning files.

CAVEATS

This module is only of use if there are active testers for your platform.

Note that the lack of passing tests in the testers database does not mean that a module will not run on your platform, only that it will not be downloded. (There may be a lag of several days before test results of the newest modules appear in the database.) Likewise, passing tests do not mean that a module will run on your platform.

If the way filters are handled in CPAN::Mini is changed in the future, then some of these issues can be resolved by downloading the most recent version which has passed tests.

SEE ALSO

CPAN::Mini

CPAN::WWW::Testers

CPAN Testers http://cpantesters.org

AUTHOR

Robert Rothenberg <rrwo at cpan.org>

Barbie <barbie@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2005-2014 by Robert Rothenberg. All Rights Reserved. Copyright (C) 2014 by Barbie.

This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.