mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Replace module_installed with eval.
This commit is contained in:
parent
baee503407
commit
5c88e3df25
@ -37,8 +37,7 @@ our @EXPORT = qw(create_directory
|
|||||||
get_cpu_count
|
get_cpu_count
|
||||||
get_version
|
get_version
|
||||||
read_config_file
|
read_config_file
|
||||||
write_config_file
|
write_config_file);
|
||||||
module_installed);
|
|
||||||
|
|
||||||
sub create_directory($$) {
|
sub create_directory($$) {
|
||||||
my ($location, $permissions) = @_;
|
my ($location, $permissions) = @_;
|
||||||
@ -90,12 +89,6 @@ sub get_version {
|
|||||||
return %version;
|
return %version;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub module_installed($) {
|
|
||||||
my $module = shift;
|
|
||||||
eval("use $module;");
|
|
||||||
return !$@;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_cpu_count {
|
sub get_cpu_count {
|
||||||
my $count = 1;
|
my $count = 1;
|
||||||
if ($^O =~ /bsd/) {
|
if ($^O =~ /bsd/) {
|
||||||
|
@ -26,10 +26,10 @@ use warnings FATAL => qw(all);
|
|||||||
use make::common;
|
use make::common;
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
unless (module_installed("LWP::Simple")) {
|
unless (eval "use LWP::Simple; 1") {
|
||||||
die "Your system is missing the LWP::Simple Perl module!";
|
die "Your system is missing the LWP::Simple Perl module!";
|
||||||
}
|
}
|
||||||
unless (module_installed("Crypt::SSLeay") || module_installed("IO::Socket::SSL")) {
|
unless (eval "use Crypt::SSLeay; 1" || eval "use IO::Socket::SSL; 1") {
|
||||||
die "Your system is missing the Crypt::SSLeay or IO::Socket::SSL Perl modules!";
|
die "Your system is missing the Crypt::SSLeay or IO::Socket::SSL Perl modules!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user