CPAN::Mini::Tested - Create a CPAN mirror using modules with passing test reports
use CPAN::Mini::Tested; CPAN::Mini::Tested->update_mirror( remote => "http://cpan.mirrors.comintern.su", local => "/usr/share/mirrors/cpan", trace => 1 );
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:
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.
The maximum age of the local copy of the testers database, in days. The default is
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).
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.
The location of the local copy of the CPAN Testers database. Defaults to the root directory of
The platform that tests are expected to pass. Defaults to the current platform
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.
Connection parameters for DBI. In most cases these can be ignored.
The number of seconds it caches database queries. Defaults to
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.
The following methods are subclasses from CPAN::Mini:
In addition to noting if a module is in the exclusion list, it also notes if it has not passed any tests.
Downloads the latest cpanstats.db database file (if needed) and connects to the database before it begins downloading indices.
Also notes if the file is the cpanstats.db databse file.
Disconnects from the database before cleaning files.
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.
CPAN Testers http://cpantesters.org
Robert Rothenberg <rrwo at cpan.org>
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.