Don't fail just because a single CPAN module is missing
https://www.virtualmin.com/node/16819
This commit is contained in:
@@ -24,3 +24,5 @@ Modules can be forcibly compiled and install from the latest source instead of A
|
||||
---- Changes since 1.440 ----
|
||||
Sped up the fetching of Perl modules installed from RPM and Debian packages.
|
||||
Switched the install and current modules tabs.
|
||||
---- Changes since 1.530 ----
|
||||
When upgrading multiple Perl modules from CPAN, don't give up because just one could not be found.
|
||||
|
||||
+25
-2
@@ -125,11 +125,28 @@ elsif ($in{'source'} == 3) {
|
||||
}
|
||||
}
|
||||
close(LIST);
|
||||
|
||||
# Fail if any modules are missing from CPAN
|
||||
for($i=0; $i<@cpan; $i++) {
|
||||
push(@missing, "<tt>$cpan[$i]</tt>") if (!$source[$i]);
|
||||
}
|
||||
&install_error(&text('download_ecpan', join(" ", @missing)))
|
||||
if (@missing);
|
||||
|
||||
if ($in{'missingok'}) {
|
||||
# If missing modules are OK, exclude them from the sources list
|
||||
for($i=0; $i<@cpan; $i++) {
|
||||
if (!$source[$i]) {
|
||||
splice(@source, $i, 1);
|
||||
splice(@cpan, $i, 1);
|
||||
$i--;
|
||||
}
|
||||
}
|
||||
@cpan || &install_error(&text('download_ecpan',
|
||||
join(" ", @missing)));
|
||||
}
|
||||
elsif (@missing) {
|
||||
# Fail due to missing modules
|
||||
&install_error(&text('download_ecpan', join(" ", @missing)));
|
||||
}
|
||||
$source = join("<br>", @source);
|
||||
|
||||
# Download the actual modules
|
||||
@@ -285,6 +302,12 @@ for($i=0; $i<@mods; $i++) {
|
||||
print &ui_table_row(@mods > 1 ? $text{'download_mods'} : $text{'download_mod'},
|
||||
$modmsg);
|
||||
|
||||
# Missing modules
|
||||
if (@missing) {
|
||||
print &ui_table_row($text{'download_missingok'},
|
||||
join(" ", @missing));
|
||||
}
|
||||
|
||||
# Source
|
||||
print &ui_table_row($text{'download_src'}, $source);
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ download_missing=Missing $1 modules
|
||||
download_nomissing=All installed
|
||||
download_ebuild=One or more of the Perl modules needs $1 to be built, but this Perl module is not installed.
|
||||
download_yum=Installing Perl module $1 from package $2 ..
|
||||
download_missingok=Modules missing from CPAN
|
||||
|
||||
install_title=Install Module
|
||||
install_untar=Untarring module file
|
||||
|
||||
@@ -9,7 +9,7 @@ require './cpan-lib.pl';
|
||||
|
||||
if ($in{'upgrade'}) {
|
||||
# Just redirect to the install page from CPAN
|
||||
&redirect("download.cgi?source=3&cpan=".
|
||||
&redirect("download.cgi?missingok=1&source=3&cpan=".
|
||||
&urlize(join(" ", @d)));
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user