Skip to content

Commit

Permalink
Comment module installation code
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jan 19, 2025
1 parent ed96cca commit 265f0db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ no lib '.';

use constant ASSUME_NOT_LIVING => 120;

my @needfull;
my @needfull; # Tracks required modules to be installed

# Install Pre-requisites
BEGIN {
Expand Down Expand Up @@ -92,6 +92,7 @@ BEGIN {
}
}

# Attempt to load each module and track missing ones
foreach my $module(@modules) {
eval "use $module";
if($@) {
Expand Down Expand Up @@ -130,13 +131,15 @@ BEGIN {
}
}

# Attempt to load each module and track missing ones
if(scalar(@needfull)) {
my $list = join(' ', @needfull);
print "Installing $list\n";
$ENV{'PERL_MM_USE_DEFAULT'} = 1;
# system("cpan -i $list");
system('perl -MCPAN -e \'CPAN::Shell->install("' . join('", "', @needfull) . '")\'');
}

# $Devel::FIXME::REPAIR_INC = 1;

# FIXME
Expand All @@ -160,6 +163,7 @@ BEGIN {
};
}

# Retry loading missing modules after installation
foreach my $module (@needfull) {
my ($name, $version) = $module =~ /(.+?)\s(.+)?$/;
$name ||= $module;
Expand Down

0 comments on commit 265f0db

Please sign in to comment.