From 95f74df604483af6520bcb69bbfa48a030793226 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 20 Jul 2004 15:00:30 +0000 Subject: merge netconnect::load_conf in netconnect::read_conf (and replace all calls to lload_conf with read_conf, remove all previous calls to read_conf) --- perl-install/network/netconnect.pm | 24 ++++++++++++------------ perl-install/network/tools.pm | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'perl-install/network') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 15a5a7a8b..2fb9fbdfa 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -261,7 +261,8 @@ sub real_main { data => \@connection_list, post => sub { $is_wireless = $cnx_type eq N("Wireless connection"); - load_conf($netcnx, $netc, $intf) if $::isInstall; # :-( + #- why read again the net_conf here ? + read_net_conf($netcnx, $netc, $intf) if $::isInstall; # :-( $type = $netcnx->{type} = $connections{$cnx_type}; if ($type eq 'cable') { $auto_ip = 1; @@ -1373,14 +1374,6 @@ sub get_profiles() { map { if_(m!([^/]*)/$!, $1) } glob("$::prefix/etc/netprofile/profiles/*/"); } -sub load_conf { - my ($netcnx, $netc, $intf) = @_; - my $current = { getVarsFromSh("$::prefix/etc/netprofile/current") }; - - $netcnx->{PROFILE} = $current->{PROFILE} || 'default'; - network::network::read_all_conf($::prefix, $netc, $intf, $netcnx); -} - sub get_net_device() { my $connect_file = $network::tools::connect_file; my $network_file = "$::prefix/etc/sysconfig/network"; @@ -1396,9 +1389,16 @@ sub get_net_device() { } sub read_net_conf { - my (undef, $netcnx, $netc) = @_; - $netc->{$_} = $netcnx->{$_} foreach 'NET_DEVICE', 'NET_INTERFACE'; - $netcnx->{$netcnx->{type}} ||= {}; + my ($netcnx, $netc, $intf) = @_; + my $current = { getVarsFromSh("$::prefix/etc/netprofile/current") }; + + $netcnx->{PROFILE} = $current->{PROFILE} || 'default'; + network::network::read_all_conf($::prefix, $netc, $intf, $netcnx); + + foreach ('NET_DEVICE', 'NET_INTERFACE') { + $netc->{$_} = $netcnx->{$_} if $netcnx->{$_} + } + $netcnx->{$netcnx->{type}} ||= {} if $netcnx->{type}; } sub start_internet { diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index aae98c90d..3e2dbaee7 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -191,9 +191,8 @@ sub is_dynamic_host { sub reread_net_conf { my ($netcnx, $netc, $intf) = @_; - network::netconnect::read_net_conf('', $netcnx, $netc); + network::netconnect::read_net_conf($netcnx, $netc, $intf); modules::load_category('net'); - network::netconnect::load_conf($netcnx, $netc, $intf); } sub convert_wep_key_for_iwconfig { -- cgit v1.2.1