The module is now available when running Webmin inside a Solaris zone, but only if Perl is not shared with the global zone.
---- Changes since 1.390 ----
Converted all code to use the new Webmin UI library, for a more consistent look.
+Modules can be forcibly compiled and install from the latest source instead of APT or YUM, using a new option on the main page.
return sort { $a->[0] cmp $b->[0] } @rv;
}
+# can_list_packaged_modules()
+# Returns 1 if we can install Perl modules from APT or YUM
+sub can_list_packaged_modules
+{
+return 0 if (!&foreign_check("software") || !$config{'incpackages'});
+&foreign_require("software", "software-lib.pl");
+return 0 if (!$software::update_system);
+return 1;
+}
+
# list_packaged_modules([refresh])
# Returns a list of Perl modules that can be installed from the system's
# package update service (ie YUM or APT).
@cpan = split(/\s+|\0/, $in{'cpan'});
# First check if YUM or APT can install this module for us
- if ($config{'incyum'}) {
+ if ($config{'incyum'} && !$in{'forcecpan'}) {
@yum = &list_packaged_modules();
foreach $c (@cpan) {
($yum) = grep { lc($_->{'mod'}) eq lc($c) } @yum;
$refreshopt = "<br>".&ui_checkbox("refresh", 1, $text{'index_refresh'},
$st[9]+$config{'refresh_days'}*24*60*60 < $now);
}
+if ($config{'incyum'} && &can_list_packaged_modules()) {
+ $cpanopt = "<br>".&ui_checkbox("forcecpan", 1,
+ $text{'index_forcecpan'}, 0);
+ }
@opts = ( [ 3, $text{'index_cpan'},
&ui_textbox("cpan", undef, 50)." ".
&ui_button("...", undef, 0, "onClick='window.ifield = document.forms[$formno].cpan; chooser = window.open(\"cpan.cgi\", \"chooser\", \"toolbar=no,menubar=no,scrollbars=yes,width=800,height=500\"); chooser.ifield = window.ifield;'").
- $refreshopt ],
+ $refreshopt.$cpanopt ],
[ 0, $text{'index_local'},
&ui_textbox("local", undef, 50)." ".
&file_chooser_button("local", 0) ],
index_installmsg=Select a new Perl module to compile and install on your system.
index_cpan=From CPAN, named
index_refresh=Refresh module list from CPAN
+index_forcecpan=Always install latest version from source
index_local=From local file
index_uploaded=From uploaded file
index_ftp=From ftp or http URL