Skip to content

Commit

Permalink
improve CheckModules script
Browse files Browse the repository at this point in the history
  • Loading branch information
reneeb committed Jun 12, 2013
1 parent badca1c commit 8668e79
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion opar.CheckModules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

my $section_seen = 0;

my @to_install;

open my $fh, '<', $ini_file or die $!;
while ( my $line = <$fh> ) {
chomp $line;
Expand All @@ -31,6 +33,20 @@
my $error;
eval "use $module $version; 1;" or $error = $@;

print sprintf "%-40s %s %s\n", $module, '.' x 15, ( $error || 'ok' );
print sprintf "%-40s %s %s\n", $module, '.' x 15, ( $error ? 'not ok' : 'ok' );

push @to_install, $module if $error;
}
close $fh;

if ( @to_install ) {
my $install_modules = join ' ', @to_install;
print qq~
please run the following commands:
curl -L http://cpanmin.us | perl - App::cpanminus
cpanm $install_modules
~;
}

0 comments on commit 8668e79

Please sign in to comment.