NAME

CPAN::Reporter::Smoker::Safer - Turnkey smoking of installed distros

VERSION

Version 0.01

SYNOPSIS

perl -MCPAN::Reporter::Smoker::Safer -e start

DESCRIPTION

This is a subclass of CPAN::Reporter::Smoker that will limit the set of tested distributions to ones that are already installed on the system (and their dependencies). This is based on the assumption that, having been installed, the distributions and their dependencies are trusted. This can be used to run partial smoke testing on a box that normally wouldn't be desired for full smoke testing (i.e. isn't a dedicated/isolated environment). Another potential use is to vet everything before upgrading.

WARNING -- smoke testing is risky

While in theory this is much safer than full CPAN smoke testing, ALL of the same risks (see CPAN::Reporter::Smoker) still apply:

Smoke testing will download and run programs that other people have uploaded to CPAN. These programs could do *anything* to your system, including deleting everything on it. Do not run CPAN::Reporter::Smoker unless you are prepared to take these risks.

USAGE

start()

This is an overload of CPAN::Reporter::Smoker::start, and supports the same arguments, with the exception of list which is set internally. In addition, the following arguments are support:

safer__mask

Scalar; Defaults to '/./'; Value is passed to CPAN::Shell::expand() for filtering the module list (applies to module names, not distro names).

safer__filter

Code ref; Defaults to "__filter". First argument is the CPAN::Reporter::Smoker::Safer class/object; Second argument is a CPAN::Distribution object. Return value should be 1 to accept, and 0 to reject the distribution.

	safer__filter => sub {
	  my ($safer, $dist) = @_;
	  ...
          return 1; 
	},

INTERNAL METHODS

__filter

Used as the default "safer__filter" code ref.

  • Excludes any distro who's name (e.g. A/AU/AUTHOR/Foo-Bar-1.23.tar.gz) matches one of the regexes in @RE_EXCLUSIONS.

  • Exclude any distro that was uploaded to CPAN less than MIN_DAYS_OLD days ago.

  • Exclude any distro that has less than MIN_REPORTS CPAN Testers reports.

These rely on the following package variables:

MIN_REPORTS

Scalar; Defaults to 10

MIN_DAYS_OLD

Scalar; Defaults to 14

RE_EXCLUSIONS

Array of regexes. Defaults to ( qr#/perl-5\.#, qr#/mod_perl-\d# ). Any distribution names that match any of the items will be excluded.

Note that the disabled.yml functionality might be more suitable. See CPAN::Reporter::Smoker, CPAN, and CPAN::Distroprefs for more details.

__installed_dists

Returns an array ref of dist names (e.g. 'ANDK/CPAN-1.9301.tar.gz' ).

CPAN::Reporter::Smoker::Safer->__installed_dists( $mask, $filter );

mask is optional, and is same value as "safer__mask". filter is optional, and is same value as "safer__filter".

myprint, myexit, mywarn, mydie

These are included as a hack, so that $CPAN::Frontend can be set to CPAN::Reporter::Smoker::Safer so that the output of CPAN::Distribution::reports() can be trapped and parsed.

AUTHOR

David Westbrook (CPAN: davidrw), <dwestbrook at gmail.com>

BUGS

Please report any bugs or feature requests to bug-cpan-reporter-smoker-safer at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPAN-Reporter-Smoker-Safer. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc CPAN::Reporter::Smoker::Safer

You can also look for information at:

SEE ALSO

ACKNOWLEDGEMENTS

The cpan-testers-discuss mailling list for supporting and enhancing the concept.

COPYRIGHT & LICENSE

Copyright 2009 David Westbrook, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.