Skip to content

Commit

Permalink
Fix ModuleManager failing when:
Browse files Browse the repository at this point in the history
- LWP::Simple is not installed.
- Crypt::SSLeay or IO::Socket::SSL are not installed.

This fixes #154.
  • Loading branch information
SadieCat authored and attilamolnar committed Nov 8, 2012
1 parent e74da8e commit 999ba80
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
9 changes: 8 additions & 1 deletion make/configure.pm
Expand Up @@ -31,7 +31,7 @@ use warnings FATAL => qw(all);
use Exporter 'import'; use Exporter 'import';
use POSIX; use POSIX;
use make::utilities; use make::utilities;
our @EXPORT = qw(promptnumeric dumphash is_dir getmodules getrevision getcompilerflags getlinkerflags getdependencies nopedantic resolve_directory yesno showhelp promptstring_s); our @EXPORT = qw(promptnumeric dumphash is_dir getmodules getrevision getcompilerflags getlinkerflags getdependencies nopedantic resolve_directory yesno showhelp promptstring_s module_installed);


my $no_git = 0; my $no_git = 0;


Expand Down Expand Up @@ -193,6 +193,13 @@ sub promptnumeric($$)
} }
} }


sub module_installed($)
{
my $module = shift;
eval("use $module;");
return !$@;
}

sub promptstring_s($$) sub promptstring_s($$)
{ {
my ($prompt,$default) = @_; my ($prompt,$default) = @_;
Expand Down
14 changes: 13 additions & 1 deletion modulemanager
Expand Up @@ -21,10 +21,22 @@


use strict; use strict;
use warnings FATAL => qw(all); use warnings FATAL => qw(all);
use LWP::Simple;


use make::configure; use make::configure;



if (!module_installed("LWP::Simple"))
{
die "Your system is missing the LWP::Simple Perl module!";
}

if (!module_installed("Crypt::SSLeay") && !module_installed("IO::Socket::SSL"))
{
die "Your system is missing the Crypt::SSLeay or IO::Socket::SSL Perl modules!";
}

use LWP::Simple;

our @modlist; our @modlist;


my %installed; my %installed;
Expand Down

0 comments on commit 999ba80

Please sign in to comment.