print STDERR "fastrpc: check $arg->{'module'}\n" if ($gconfig{'rpcdebug'});
$rawrv = &serialise_variable(
{ 'status' => 1,
- 'rv' => &foreign_check($arg->{'module'}) } );
+ 'rv' => &foreign_check($arg->{'module'}, undef, undef,
+ $arg->{'api'}) } );
}
elsif ($arg->{'action'} eq 'config') {
# Get the config for some module
category=system
desc_tr=Disk ve Að Dosya Sistemi
os_support=slackware-linux redhat-linux mandrake-linux solaris debian-linux suse-linux united-linux freebsd hpux unixware open-linux turbo-linux corel-linux openbsd cobalt-linux lfs-linux msc-linux generic-linux gentoo-linux irix netbsd trustix-linux sol-linux coherent-linux openmamba-linux
+api_os_support=macos
desc=Disk and Network Filesystems
desc_es=Sistemas de Archivo de Disco y Red
desc_sv=Filsystem för diskar och nätverk
# Check if some module is supported
print &serialise_variable(
{ 'status' => 1,
- 'rv' => &foreign_check($arg->{'module'}) } );
+ 'rv' => &foreign_check($arg->{'module'}, undef, undef,
+ $arg->{'api'}) } );
}
elsif ($arg->{'action'} eq 'config') {
# Get the config for some module
sub get_space_status
{
-return { 'up' => -1 } if (!&foreign_check("mount"));
+return { 'up' => -1 } if (!&foreign_check("mount", 1));
&foreign_require("mount", "mount-lib.pl");
local $m;
foreach $f (&mount::list_mounted()) {
if ($_[0]->{'remote'}) {
# Check on the remote server
foreach $m (@_[1..$#_]) {
- &remote_foreign_check($_[0]->{'remote'}, $m) ||
+ &remote_foreign_check($_[0]->{'remote'}, $m, 1) ||
&error(&text('depends_remote', "<tt>$m</tt>",
"<tt>$_[0]->{'remote'}</tt>"));
}
foreach $m (@_[1..$#_]) {
local %minfo = &get_module_info($m);
%minfo || &error(&text('depends_mod', "<tt>$m</tt>"));
- &check_os_support(\%minfo) ||
+ &check_os_support(\%minfo, undef, undef, 1) ||
&error(&text('depends_os', "<tt>$minfo{'desc'}</tt>"));
}
$_[0]->{'depends'} = join(" ", @_[1..$#_]);
}
}
-# check_os_support(&minfo, [os-type, os-version])
+# check_os_support(&minfo, [os-type, os-version], [api-only])
# Returns 1 if some module is supported on the current operating system, or the
# OS supplies as parameters.
sub check_os_support
{
local $oss = $_[0]->{'os_support'};
+if ($_[3] && $oss && $_[0]->{'api_os_support'}) {
+ # May provide usable API
+ $oss .= " ".$_[0]->{'api_os_support'};
+ }
if ($_[0]->{'nozone'} && &running_in_zone()) {
# Not supported in a Solaris Zone
return 0;
return "<input type=button onClick='ifield = form.$_[0]; chooser = window.open(\"$gconfig{'webprefix'}/group_chooser.cgi?multi=$_[1]&group=\"+escape(ifield.value), \"chooser\", \"toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=$w,height=$h\"); chooser.ifield = ifield; window.ifield = ifield' value=\"...\">\n";
}
-# foreign_check(module)
+# foreign_check(module, [api-only])
# Checks if some other module exists and is supported on this OS
sub foreign_check
{
+local ($mod, $api) = @_;
local %minfo;
-local $mdir = &module_root_directory($_[0]);
+local $mdir = &module_root_directory($mod);
&read_file_cached("$mdir/module.info", \%minfo) || return 0;
-return &check_os_support(\%minfo);
+return &check_os_support(\%minfo, undef, undef, $api);
}
# foreign_exists(module)
last;
}
}
-close(OUT);
if (kill('TERM', $pid) && time() - $start >= $_[1]) {
$timed_out = 1;
}
'args' => [ @_[3 .. $#_] ] } );
}
-# remote_foreign_check(server, module)
+# remote_foreign_check(server, module, [api-only])
# Checks if some module is installed and supported on a remote server
sub remote_foreign_check
{
return &remote_rpc_call($_[0], { 'action' => 'check',
- 'module' => $_[1] });
+ 'module' => $_[1],
+ 'api' => $_[2] });
}
# remote_foreign_config(server, module)