summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-14 13:50:27 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-14 13:50:27 +0000
commit33dfcba919dc587ea3724f194b6639b90514efc1 (patch)
treee92165e78553b41a477b6c8a219e934703ceee8c /lib
parentb07443105db538e7425b4ef5fd2d2ccdc6e0bb46 (diff)
downloaddrakx-net-33dfcba919dc587ea3724f194b6639b90514efc1.tar
drakx-net-33dfcba919dc587ea3724f194b6639b90514efc1.tar.gz
drakx-net-33dfcba919dc587ea3724f194b6639b90514efc1.tar.bz2
drakx-net-33dfcba919dc587ea3724f194b6639b90514efc1.tar.xz
drakx-net-33dfcba919dc587ea3724f194b6639b90514efc1.zip
split component_get_option function
Diffstat (limited to 'lib')
-rw-r--r--lib/network/thirdparty.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/network/thirdparty.pm b/lib/network/thirdparty.pm
index be1fe88..ef510ff 100644
--- a/lib/network/thirdparty.pm
+++ b/lib/network/thirdparty.pm
@@ -88,6 +88,11 @@ sub device_get_option {
$value == 1 ? $o_default || $settings->{name} : $value;
}
+sub component_get_option {
+ my ($settings, $component, $option) = @_;
+ ref $settings->{$component} eq 'HASH' && $settings->{$component}{$option} || $settings->{$option};
+}
+
sub find_settings {
my ($settings_list, $driver) = @_;
find {
@@ -129,7 +134,7 @@ sub get_checked_element {
sub warn_not_found {
my ($in, $settings, $driver, $option, @packages) = @_;
my %opt;
- $opt{$_} = ref $settings->{$option} eq 'HASH' && $settings->{$option}{$_} || $settings->{$_} foreach qw(url explanations no_club no_package);
+ $opt{$_} = component_get_option($settings, $option, $_) foreach qw(url explanations no_club no_package);
my $checked = get_checked_element($settings, $driver, $option);
my $component_name = ref $settings->{$option} eq 'HASH' && translate($settings->{$option}{component_name}) || $option;
$in->ask_warn(N("Error"),