summaryrefslogtreecommitdiffstats
path: root/perl-install/network/thirdparty.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-09-11 20:52:22 +0000
committerOlivier Blin <oblin@mandriva.org>2005-09-11 20:52:22 +0000
commitdecfc42287d9bd364e555cbd68babe08aacb1881 (patch)
treefa0cee064eb1c4636c11eaa20dd2bb55375a7814 /perl-install/network/thirdparty.pm
parent5876e1a35bcb9851efafb195593f94cc5ff0663e (diff)
downloaddrakx-decfc42287d9bd364e555cbd68babe08aacb1881.tar
drakx-decfc42287d9bd364e555cbd68babe08aacb1881.tar.gz
drakx-decfc42287d9bd364e555cbd68babe08aacb1881.tar.bz2
drakx-decfc42287d9bd364e555cbd68babe08aacb1881.tar.xz
drakx-decfc42287d9bd364e555cbd68babe08aacb1881.zip
add more details when the firmware file can't be found
Diffstat (limited to 'perl-install/network/thirdparty.pm')
-rw-r--r--perl-install/network/thirdparty.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/perl-install/network/thirdparty.pm b/perl-install/network/thirdparty.pm
index 956879364..6676dfed6 100644
--- a/perl-install/network/thirdparty.pm
+++ b/perl-install/network/thirdparty.pm
@@ -61,7 +61,7 @@ use log;
#- o no_club:
#- 1 if the package isn't available on Mandriva club
-my $hotplug_firmware_prefix = "$::prefix/lib/hotplug/firmware";
+my $firmware_directory = "/lib/hotplug/firmware";
my %network_settings = (
rtc =>
@@ -312,10 +312,11 @@ sub warn_not_found {
$opt{$_} = $settings->{$option}{$_} || $settings->{$_} foreach qw(url explanations no_club);
$in->ask_warn(N("Error"),
N("Some packages (%s) are required but aren't available.", @packages) .
- if_(!$opt{no_club}, "\n" . N("These packages can be found in Mandriva Club or in Mandriva commercial releases.")) .
- if_($opt{url}, "\n\n" . N("The required files can also be installed from this URL:
+ (!$opt{no_club} && "\n" . N("These packages can be found in Mandriva Club or in Mandriva commercial releases.")) .
+ ($option eq 'firmware' && "\n\n" . N("Info: ") . "\n" . N("due to missing %s", get_firmware_path($settings))) .
+ ($opt{url} && "\n\n" . N("The required files can also be installed from this URL:
%s", $opt{url})) .
- if_($opt{explanations}, "\n\n" . translate($opt{explanations})));
+ ($opt{explanations} && "\n\n" . translate($opt{explanations})));
}
sub is_file_installed {
@@ -330,11 +331,17 @@ sub is_module_installed {
find { m!/$module\.k?o! } cat_("$::prefix/lib/modules/" . c::kernel_version() . '/modules.dep');
}
-sub is_firmware_installed {
+sub get_firmware_path {
my ($settings) = @_;
my $wildcard = exists $settings->{firmware} && $settings->{firmware}{test_file} or return;
- my $path = $settings->{firmware}{prefix} || $hotplug_firmware_prefix;
- scalar glob_("$::prefix$path/$wildcard");
+ my $path = $settings->{firmware}{prefix} || $firmware_directory;
+ "$::prefix$path/$wildcard";
+}
+
+sub is_firmware_installed {
+ my ($settings) = @_;
+ my $pattern = get_firmware_path($settings) or return;
+ scalar glob_($pattern);
}
sub find_file_on_windows_system {