From bce59e8e1b55eb5ac91f30937a93aa290af40026 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 29 Dec 2002 12:16:30 +0000 Subject: - do not use a global $in in network::modem, pass it as a parameter - create network::modem::ppp_configure_raw() which doesn't need $in (it is only used by network::modem::ppp_configure(), but this is clearer that way) --- perl-install/network/modem.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'perl-install/network/modem.pm') diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm index 3d75a5635..b277ccb56 100644 --- a/perl-install/network/modem.pm +++ b/perl-install/network/modem.pm @@ -6,11 +6,10 @@ use modules; use detect_devices; use mouse; use network::tools; -use MDK::Common::Globals "network", qw($in); use Data::Dumper; sub configure { - my ($netcnx, $mouse, $netc, $intf) = @_; + my ($in, $netcnx, $mouse, $netc, $intf) = @_; $netcnx->{type} = 'modem'; my $modem = $netcnx->{$netcnx->{type}}; # $netcnx->{$netcnx->{type}} = {}; @@ -33,7 +32,7 @@ sub configure { last; } } - ppp_choose($netc, $modem, $mouse) or return; + ppp_choose($in, $netc, $modem, $mouse) or return; write_cnx_script($netc, "modem", q( /sbin/route del default @@ -49,9 +48,13 @@ killall pppd sub ppp_configure { my ($in, $modem) = @_; $modem or return; + $in->do_pkgs->install('ppp') if !$::testing; + ppp_configure_raw($modem); +} +sub ppp_configure_raw { + my ($modem) = @_; any::devfssymlinkf($modem, 'modem') if $modem->{device} ne "/dev/modem"; - $in->do_pkgs->install('ppp') if !$::testing; my %toreplace; $toreplace{$_} = $modem->{$_} foreach qw(connection phone login passwd auth domain dns1 dns2); @@ -211,7 +214,7 @@ END } sub ppp_choose { - my ($netc, $modem, $mouse) = @_; + my ($in, $netc, $modem, $mouse) = @_; $mouse ||= {}; $mouse->{device} ||= readlink "$::prefix/dev/mouse"; @@ -244,7 +247,7 @@ sub ppp_choose { #- TODO: add choice between hcf/hsf sub winmodemConfigure { - my ($netc) = @_; + my ($in, $netc) = @_; my $type; foreach (keys %{$netc->{autodetect}{winmodem}}) { -- cgit v1.2.1