mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-22 02:39:04 +00:00
55 lines
1.1 KiB
Perl
Executable File
55 lines
1.1 KiB
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
use warnings FATAL => 'all';
|
|
use English;
|
|
|
|
# This script is for developers to see if their box has all the modules
|
|
# necessary for testing Percona Toolkit. Any missing modules are printed
|
|
# to STDERR and installed modules are printed to STDOUT.
|
|
#
|
|
# In addition to these modules, many non-standard programs are needed
|
|
# for other tasks, like building packages, writing test coverage, etc.
|
|
#
|
|
# Exits 0 if all modules are installed, else exits non-zero.
|
|
|
|
my @modules = qw(
|
|
Data::Dumper
|
|
DBD::mysql
|
|
DBI
|
|
Digest::Crc32
|
|
Digest::MD5
|
|
File::Basename
|
|
File::Find
|
|
File::Spec
|
|
File::Temp
|
|
Getopt::Long
|
|
IO::File
|
|
IO::Uncompress::Inflate
|
|
List::Util
|
|
POSIX
|
|
Socket
|
|
Term::ReadKey
|
|
Test::More
|
|
Time::HiRes
|
|
Time::Local
|
|
);
|
|
|
|
my $exit_status = 0;
|
|
my $fmt = "%-23s %s\n";
|
|
|
|
printf $fmt, "Perl", `perl -v | perl -ne '/v([\\d\\.]+)/ && print \$1'`;
|
|
|
|
foreach my $module (@modules) {
|
|
my $version = "Not installed";
|
|
eval "require $module";
|
|
if ( $EVAL_ERROR ) {
|
|
$exit_status = 1;
|
|
}
|
|
else {
|
|
$version = ${"${module}::VERSION"};
|
|
}
|
|
printf $fmt, $module, $version;
|
|
}
|
|
|
|
exit $exit_status;
|