| Posted on 2008-08-02 20:27:53-07 by car54 in response to 8477 |
| Re: Request Test::Reporter and after that endless loop on Test::Deep |
|
Thanks for responding Fergal. Below is the script that's installing the Perl Modules.
#!/usr/bin/perl -w
use strict;
use warnings;
use CPAN;
require './common.pl';
$ENV{PATH} = $ENV{PATH} . ':/usr/mysql/bin';
$ENV{LC_ALL} = 'C';
my @names = qw(CPAN URI HTML::Tagset HTML::HeadParser HTML::Form HTML::Parser Text::Autoformat
HTTP::Date DBI DBD::mysql Time::HiRes AppConfig Template CGI
Apache::Cookie Apache::DBI Apache::SubProcess Apache::Session GD GD::Text GD::Graph);
my @mods;
while ( defined(my $nm = shift @names) ) {NAMES:{
printbanner ( "RESOLVE NAME $nm" );
EXPAND: {
my @submods = CPAN::Shell->expandany ( $nm );
unless ( scalar @submods ) {
if ( prompt_rs ( "ERROR: Could not find object $nm on CPAN." ) ) {
redo EXPAND;
} else {
next NAMES;
}
}
print "NAME $nm resolved to module(s): ", join ( ',', map { $_->id } @submods ), "\n";
push @mods, @submods;
}
while ( defined(my $mod = shift @mods) ) {INST:{
$mod->undelay;
printbanner ( "INSTALL ", $mod->id );
if ( $mod->uptodate ) {
print "Module ", $mod->id, " ($mod) is up to date\n";
next;
}
$mod->install;
if ( scalar @CPAN::Queue::All ) { # add new names to @names
my @lst;
while ( defined(my $nn = CPAN::Queue::first()) ) {
push @lst, $nn;
CPAN::Queue->delete_first ( $nn );
}
print '-' x 80, "\nNOTE: prepending names ", join ( ',', @lst ), "\n";
unshift @names, @lst;
#unshift @mods, $mod; # not needed since it's in @lst automatically
CPAN::Queue::nullify_queue();
next NAMES;
}
unless ( $mod->uptodate ) {
unless ( $mod->{force_update} ) {
print 'ERROR: failed to install ' . $mod->id . " without force, trying to force install\n";
$mod->undelay;
$mod->force;
$mod->install;
redo;
}
if ( prompt_rs ( "ERROR: failed to install module " . $mod->id ) ) {
$mod->undelay;
$mod->force;
$mod->install;
redo;
} else {
next;
}
}
}}
}}
|
| Direct Responses: Write a response |