Here's a snippet that gets all the installed distributions (based on
what the CPAN 'autobundle' command does), and then runs
CPAN::Reporter::Smoker against that list of distributions.

  use CPAN;
  use CPAN::Reporter::Smoker;
  my %dists;
  foreach my $mod ( CPAN::Shell->expand('Module','/./') ){
    my $d = $mod->distribution or next;
    $d = $d->pretty_id;
    next if exists $dists{$d};
    next if ! $mod->inst_file;
    $dists{$d} = undef;
  };
  my @dists = sort grep { ! m#/perl-5\.# } keys %dists;
  my $n = scalar @dists;
  warn "Got $n distros -- starting smoker";
  CPAN::Reporter::Smoker::start( list => \...@dists );

Whereas you wouldn't want to run a smoker on a "regular" machine (e.g.
a $work box, or your day-to-day windows desktop, or laptop, etc),
this is reasonably safe since it's only testing distros that you
already installed, which implies that they (and their dependencies)
are trusted.
Also lets you easily submit reports for all the modules you're actual
using, w/o a separate smoke environment.


so, looking for comments/feedback ...

  is this a good/bad (any additional risks??) idea?

  Any better way to get the distro list?  (note this tests the newest
version, even if it's an older one actually installed)

  Is this useful for others?
    If so, as a snippet (e.g. posted on wiki)?
    as a subclass (name??) of CPAN::Reporter::Smoker?
    as an additional exported sub (name??) in CPAN::Reporter::Smoker?


thanks,
--david

Reply via email to