Talk about a rapid response! Thanks!

But, IIUYC, I can't get anything until the distribution has made it to ftp://ftp.cpan.org -- at least not through the cpan shell. For normal installation purposes, that's fine. But I was wondering if there was something I could use (other than manual downloading) for a quick look-see-and-test.

Jim Keenan

UPDATE one day later: I've decided to try hacking something which uses LWP::Simple::getstore() to retrieve the file from http://www.cpan.org, tests it, and sends a report with Test::Reporter. I'll post it when I get it somewhat functional. Thanks for all who have read this far.

UPDATE 2: Here is the aforepromised hack. It DWIMs with one key exception: The mail sent isn't showing up immediately on perl.cpan.testers (either web interface or newsgroup). This is the first time I've attempted to send mail from within a Perl program, so maybe there's something I don't understand. OTOH, when I've sent ordinary mail to that list, it has sometimes taken 12 hours to get posted.

In any event, have at it gang!

#!/usr/local/bin/perl use strict; use warnings; use Test::Reporter; use Data::Dumper; use LWP::Simple; use Getopt::Std; use Carp; $| = 1; my %opts; getopts( "vsh", \%opts ); croak Usage() if ( $opts{h} ); my $workdir = "/Users/jimk/Documents/Downloads"; chdir $workdir or croak "Unable to change to $workdir: $!"; my $screen = "$workdir/screen"; if (-f $screen) { unlink $screen or croak "Unable to unlink $screen: $!"; } my $err = "$workdir/error"; if (-f $err) { unlink $err or croak "Unable to unlink $err: $!"; } my ($module, $version, $authorpath) = @ARGV[0..2]; $module =~ s/::/-/g; my $authorid; $authorpath =~ m{/?([^/]*?)$}; $authorid = $1; my $source = "http://www.cpan.org/modules/by-authors/id/$authorpath/$m +odule-$version.tar.gz"; print "$source\n"; my $localfile = "$module-$version.tar.gz"; my $localdir = "$module-$version"; print "$localfile $localdir\n"; my $httpresponsecode = getstore($source, $localfile); print $httpresponsecode, "\n"; my $comment = q{}; system("tar xzvf $localfile > $screen 2>$err"); gather_comments($screen, $err); chdir $localdir or croak "Unable to change to $localdir: $!"; system("perl Makefile.PL > $screen 2>$err"); gather_comments($screen, $err); system("make > $screen 2>$err"); gather_comments($screen, $err); my $maketestreturn; if ($opts{v}) { $maketestreturn = system("make test TEST_VERBOSE=1 > $screen 2>$er +r"); } else { $maketestreturn = system("make test > $screen 2>$err"); } gather_comments($screen, $err); print 'return value from make test: ', $maketestreturn, "\n\n"; my $grade; unless ($maketestreturn) { $grade = 'pass'; } else { $grade = 'fail'; } $comment = q{} if $grade eq 'pass'; my $reporter = Test::Reporter->new( grade => $grade, distribution => $localdir, from => 'Jim Keenan (jkeenan_cpan_testing@yahoo.com)', comments => $comment, ); if ($opts{s}) { print "Sending mail ...\n"; $reporter->send() || croak $reporter->errstr(); } else { print $reporter->subject(), "\n"; print $reporter->from(), "\n"; print "\nREPORT:\n\n"; print $reporter->report, "\n"; print $reporter->grade(), "\n"; print "No mail sent\n"; } print "Finished\n"; sub gather_comments { my @files = @_; local $_; for (@files) { open my $fh, $_ or croak "Unable to open $_: $!"; local $/ = undef; $comment .= <$fh>; close $fh or croak "Unable to close $_: $!"; } } sub Usage { print 'Usage: "./reptest.pl [options] [distribution] [0.000] [A/A +B/ABCXYZ]"', "\n"; }

Jim Keenan


In reply to Re^2: Getting Modules Hot Off the Keyboard by jkeenan1
in thread Getting Modules Hot Off the Keyboard by jkeenan1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.